c2runtime.js 705 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241
  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); if (t) {
  2541. if (i === "repeat-x") {
  2542. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_S, u.REPEAT);
  2543. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_T, u.CLAMP_TO_EDGE)
  2544. } else if (i === "repeat-y") {
  2545. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_S, u.CLAMP_TO_EDGE);
  2546. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_T, u.REPEAT)
  2547. } else {
  2548. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_S, u.REPEAT);
  2549. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_T, u.REPEAT)
  2550. }
  2551. } else {
  2552. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_S, u.CLAMP_TO_EDGE);
  2553. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_WRAP_T, u.CLAMP_TO_EDGE)
  2554. } if (n) {
  2555. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_MAG_FILTER, u.LINEAR);
  2556. if (a) {
  2557. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_MIN_FILTER, u.LINEAR_MIPMAP_LINEAR);
  2558. u.generateMipmap(u.TEXTURE_2D)
  2559. } else u.texParameteri(u.TEXTURE_2D, u.TEXTURE_MIN_FILTER, u.LINEAR)
  2560. } else {
  2561. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_MAG_FILTER, u.NEAREST);
  2562. u.texParameteri(u.TEXTURE_2D, u.TEXTURE_MIN_FILTER, u.NEAREST)
  2563. }
  2564. u.bindTexture(u.TEXTURE_2D, null);
  2565. this.lastTexture = null;
  2566. o.c2width = e.width;
  2567. o.c2height = e.height;
  2568. o.c2refcount = 1;
  2569. o.c2texkey = s;
  2570. E.push(o);
  2571. S[s] = o;
  2572. return o
  2573. };
  2574. v.prototype.createEmptyTexture = function(e, t, n, r) {
  2575. this.endBatch();
  2576. var i = this.gl;
  2577. var s = i.createTexture();
  2578. i.bindTexture(i.TEXTURE_2D, s);
  2579. 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);
  2580. i.texParameteri(i.TEXTURE_2D, i.TEXTURE_WRAP_S, i.CLAMP_TO_EDGE);
  2581. i.texParameteri(i.TEXTURE_2D, i.TEXTURE_WRAP_T, i.CLAMP_TO_EDGE);
  2582. i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MAG_FILTER, n ? i.LINEAR : i.NEAREST);
  2583. i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MIN_FILTER, n ? i.LINEAR : i.NEAREST);
  2584. i.bindTexture(i.TEXTURE_2D, null);
  2585. this.lastTexture = null;
  2586. s.c2width = e;
  2587. s.c2height = t;
  2588. E.push(s);
  2589. return s
  2590. };
  2591. v.prototype.videoToTexture = function(e, t, n) {
  2592. this.endBatch();
  2593. var r = this.gl;
  2594. r.bindTexture(r.TEXTURE_2D, t);
  2595. r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, r.RGBA, n ? r.UNSIGNED_SHORT_4_4_4_4 : r.UNSIGNED_BYTE, e);
  2596. r.bindTexture(r.TEXTURE_2D, null);
  2597. this.lastTexture = null
  2598. };
  2599. v.prototype.deleteTexture = function(e) {
  2600. if (!e) return;
  2601. if (typeof e.c2refcount !== "undefined" && e.c2refcount > 1) {
  2602. e.c2refcount--;
  2603. return
  2604. }
  2605. this.endBatch();
  2606. this.gl.bindTexture(this.gl.TEXTURE_2D, null);
  2607. this.lastTexture = null;
  2608. cr.arrayFindRemove(E, e);
  2609. if (typeof e.c2texkey !== "undefined") delete S[e.c2texkey];
  2610. this.gl.deleteTexture(e)
  2611. };
  2612. v.prototype.estimateVRAM = function() {
  2613. var e = this.width * this.height * 4 * 2;
  2614. var t, n, r;
  2615. for (t = 0, n = E.length; t < n; t++) {
  2616. r = E[t];
  2617. e += r.c2width * r.c2height * 4
  2618. }
  2619. return e
  2620. };
  2621. v.prototype.textureCount = function() {
  2622. return E.length
  2623. };
  2624. v.prototype.setRenderingToTexture = function(e) {
  2625. if (e === this.renderToTex) return;
  2626. var t = this.pushBatch();
  2627. t.type = l;
  2628. t.texParam = e;
  2629. this.renderToTex = e;
  2630. this.hasQuadBatchTop = false;
  2631. this.hasPointBatchTop = false
  2632. };
  2633. cr.GLWrap = v
  2634. })();
  2635. (function() {
  2636. function e(e) {
  2637. if (!e || !e.getContext && !e["dc"]) return;
  2638. if (e["c2runtime"]) return;
  2639. else e["c2runtime"] = this;
  2640. var t = this;
  2641. this.isPhoneGap = typeof window["device"] !== "undefined" && (typeof window["device"]["cordova"] !== "undefined" || typeof window["device"]["phonegap"] !== "undefined");
  2642. this.isDirectCanvas = !!e["dc"];
  2643. this.isAppMobi = typeof window["AppMobi"] !== "undefined" || this.isDirectCanvas;
  2644. this.isCocoonJs = !!window["c2cocoonjs"];
  2645. if (this.isCocoonJs) {
  2646. CocoonJS["App"]["onSuspended"].addEventListener(function() {
  2647. t["setSuspended"](true)
  2648. });
  2649. CocoonJS["App"]["onActivated"].addEventListener(function() {
  2650. t["setSuspended"](false)
  2651. })
  2652. }
  2653. this.isDomFree = this.isDirectCanvas || this.isCocoonJs;
  2654. this.isTizen = /tizen/i.test(navigator.userAgent);
  2655. this.isAndroid = /android/i.test(navigator.userAgent) && !this.isTizen;
  2656. this.isIE = /msie/i.test(navigator.userAgent) || /trident/i.test(navigator.userAgent);
  2657. this.isiPhone = /iphone/i.test(navigator.userAgent) || /ipod/i.test(navigator.userAgent);
  2658. this.isiPad = /ipad/i.test(navigator.userAgent);
  2659. this.isiOS = this.isiPhone || this.isiPad;
  2660. this.isChrome = /chrome/i.test(navigator.userAgent) || /chromium/i.test(navigator.userAgent);
  2661. this.isSafari = !this.isChrome && /safari/i.test(navigator.userAgent);
  2662. this.isWindows = /windows/i.test(navigator.userAgent);
  2663. this.isNodeWebkit = typeof window["c2nodewebkit"] !== "undefined";
  2664. this.isArcade = typeof window["is_scirra_arcade"] !== "undefined";
  2665. this.isWindows8App = !!(typeof window["c2isWindows8"] !== "undefined" && window["c2isWindows8"]);
  2666. this.isWindowsPhone8 = !!(typeof window["c2isWindowsPhone8"] !== "undefined" && window["c2isWindowsPhone8"]);
  2667. this.isBlackberry10 = !!(typeof window["c2isBlackberry10"] !== "undefined" && window["c2isBlackberry10"]);
  2668. this.devicePixelRatio = 1;
  2669. this.isMobile = this.isPhoneGap || this.isAppMobi || this.isCocoonJs || this.isAndroid || this.isiOS || this.isWindowsPhone8 || this.isBlackberry10 || this.isTizen;
  2670. if (!this.isMobile) this.isMobile = /(blackberry|bb10|playbook|palm|symbian|nokia|windows\s+ce|phone|mobile|tablet)/i.test(navigator.userAgent);
  2671. if (typeof cr_is_preview !== "undefined" && !this.isNodeWebkit && (window.location.search === "?nw" || /nodewebkit/i.test(navigator.userAgent))) {
  2672. this.isNodeWebkit = true
  2673. }
  2674. this.isDebug = typeof cr_is_preview !== "undefined" && window.location.search.indexOf("debug") > -1;
  2675. this.canvas = e;
  2676. this.canvasdiv = document.getElementById("c2canvasdiv");
  2677. this.gl = null;
  2678. this.glwrap = null;
  2679. this.ctx = null;
  2680. this.canvas.oncontextmenu = function(e) {
  2681. if (e.preventDefault) e.preventDefault();
  2682. return false
  2683. };
  2684. this.canvas.onselectstart = function(e) {
  2685. if (e.preventDefault) e.preventDefault();
  2686. return false
  2687. };
  2688. if (this.isDirectCanvas) window["c2runtime"] = this;
  2689. if (this.isNodeWebkit) {
  2690. window.ondragover = function(e) {
  2691. e.preventDefault();
  2692. return false
  2693. };
  2694. window.ondrop = function(e) {
  2695. e.preventDefault();
  2696. return false
  2697. }
  2698. }
  2699. this.width = e.width;
  2700. this.height = e.height;
  2701. this.lastwidth = this.width;
  2702. this.lastheight = this.height;
  2703. this.redraw = true;
  2704. this.isSuspended = false;
  2705. if (!Date.now) {
  2706. Date.now = function() {
  2707. return +(new Date)
  2708. }
  2709. }
  2710. this.plugins = [];
  2711. this.types = {};
  2712. this.types_by_index = [];
  2713. this.behaviors = [];
  2714. this.layouts = {};
  2715. this.layouts_by_index = [];
  2716. this.eventsheets = {};
  2717. this.eventsheets_by_index = [];
  2718. this.wait_for_textures = [];
  2719. this.triggers_to_postinit = [];
  2720. this.all_global_vars = [];
  2721. this.all_local_vars = [];
  2722. this.deathRow = new cr.ObjectSet;
  2723. this.isInClearDeathRow = false;
  2724. this.isInOnDestroy = 0;
  2725. this.isRunningEvents = false;
  2726. this.createRow = [];
  2727. this.isLoadingState = false;
  2728. this.saveToSlot = "";
  2729. this.loadFromSlot = "";
  2730. this.loadFromJson = "";
  2731. this.lastSaveJson = "";
  2732. this.signalledContinuousPreview = false;
  2733. this.suspendDrawing = false;
  2734. this.dt = 0;
  2735. this.dt1 = 0;
  2736. this.logictime = 0;
  2737. this.cpuutilisation = 0;
  2738. this.zeroDtCount = 0;
  2739. this.timescale = 1;
  2740. this.kahanTime = new cr.KahanAdder;
  2741. this.last_tick_time = 0;
  2742. this.measuring_dt = true;
  2743. this.fps = 0;
  2744. this.last_fps_time = 0;
  2745. this.tickcount = 0;
  2746. this.execcount = 0;
  2747. this.framecount = 0;
  2748. this.objectcount = 0;
  2749. this.changelayout = null;
  2750. this.destroycallbacks = [];
  2751. this.event_stack = [];
  2752. this.event_stack_index = -1;
  2753. this.localvar_stack = [
  2754. []
  2755. ];
  2756. this.localvar_stack_index = 0;
  2757. this.trigger_depth = 0;
  2758. this.pushEventStack(null);
  2759. this.loop_stack = [];
  2760. this.loop_stack_index = -1;
  2761. this.next_uid = 0;
  2762. this.next_puid = 0;
  2763. this.layout_first_tick = true;
  2764. this.family_count = 0;
  2765. this.suspend_events = [];
  2766. this.raf_id = 0;
  2767. this.timeout_id = 0;
  2768. this.isloading = true;
  2769. this.loadingprogress = 0;
  2770. this.isNodeFullscreen = false;
  2771. this.stackLocalCount = 0;
  2772. this.had_a_click = false;
  2773. this.objects_to_tick = new cr.ObjectSet;
  2774. this.objects_to_tick2 = new cr.ObjectSet;
  2775. this.registered_collisions = [];
  2776. this.temp_poly = new cr.CollisionPoly([]);
  2777. this.temp_poly2 = new cr.CollisionPoly([]);
  2778. this.allGroups = [];
  2779. this.activeGroups = {};
  2780. this.cndsBySid = {};
  2781. this.actsBySid = {};
  2782. this.varsBySid = {};
  2783. this.blocksBySid = {};
  2784. this.running_layout = null;
  2785. this.layer_canvas = null;
  2786. this.layer_ctx = null;
  2787. this.layer_tex = null;
  2788. this.layout_tex = null;
  2789. this.is_WebGL_context_lost = false;
  2790. this.uses_background_blending = false;
  2791. this.fx_tex = [null, null];
  2792. this.fullscreen_scaling = 0;
  2793. this.files_subfolder = "";
  2794. this.objectsByUid = {};
  2795. this.loaderlogo = null;
  2796. this.snapshotCanvas = null;
  2797. this.snapshotData = "";
  2798. this.load();
  2799. this.isRetina = !this.isDomFree && this.useiOSRetina && (this.isiOS || this.isTizen);
  2800. this.devicePixelRatio = this.isRetina ? window["devicePixelRatio"] || 1 : 1;
  2801. this.ClearDeathRow();
  2802. var n;
  2803. if (typeof jQuery !== "undefined" && this.fullscreen_mode > 0) this["setSize"](jQuery(window).width(), jQuery(window).height());
  2804. try {
  2805. if (this.enableWebGL && (this.isCocoonJs || !this.isDomFree)) {
  2806. n = {
  2807. depth: false,
  2808. antialias: !this.isMobile
  2809. };
  2810. var r = true;
  2811. if (this.isChrome && this.isWindows) {
  2812. var i = document.createElement("canvas");
  2813. var s = i.getContext("webgl", n) || i.getContext("experimental-webgl", n);
  2814. if (s.getSupportedExtensions().toString() === "OES_texture_float,OES_standard_derivatives,WEBKIT_WEBGL_lose_context") {
  2815. r = false
  2816. }
  2817. }
  2818. if (r) this.gl = e.getContext("webgl", n) || e.getContext("experimental-webgl", n)
  2819. }
  2820. } catch (o) {}
  2821. if (this.gl) {
  2822. if (!this.isDomFree) {
  2823. this.overlay_canvas = document.createElement("canvas");
  2824. jQuery(this.overlay_canvas).appendTo(this.canvas.parentNode);
  2825. this.overlay_canvas.oncontextmenu = function(e) {
  2826. return false
  2827. };
  2828. this.overlay_canvas.onselectstart = function(e) {
  2829. return false
  2830. };
  2831. this.overlay_canvas.width = e.width;
  2832. this.overlay_canvas.height = e.height;
  2833. this.positionOverlayCanvas();
  2834. this.overlay_ctx = this.overlay_canvas.getContext("2d")
  2835. }
  2836. this.glwrap = new cr.GLWrap(this.gl, this.isMobile);
  2837. this.glwrap.setSize(e.width, e.height);
  2838. this.ctx = null;
  2839. this.canvas.addEventListener("webglcontextlost", function(e) {
  2840. e.preventDefault();
  2841. t.onContextLost();
  2842. window["cr_setSuspended"](true)
  2843. }, false);
  2844. this.canvas.addEventListener("webglcontextrestored", function(e) {
  2845. t.glwrap.initState();
  2846. t.glwrap.setSize(t.glwrap.width, t.glwrap.height, true);
  2847. t.layer_tex = null;
  2848. t.layout_tex = null;
  2849. t.fx_tex[0] = null;
  2850. t.fx_tex[1] = null;
  2851. t.onContextRestored();
  2852. t.redraw = true;
  2853. window["cr_setSuspended"](false)
  2854. }, false);
  2855. var u, a, f, l, c, h, p, d, v, m;
  2856. for (u = 0, a = this.types_by_index.length; u < a; u++) {
  2857. p = this.types_by_index[u];
  2858. for (f = 0, l = p.effect_types.length; f < l; f++) {
  2859. d = p.effect_types[f];
  2860. d.shaderindex = this.glwrap.getShaderIndex(d.id);
  2861. this.uses_background_blending = this.uses_background_blending || this.glwrap.programUsesDest(d.shaderindex)
  2862. }
  2863. }
  2864. for (u = 0, a = this.layouts_by_index.length; u < a; u++) {
  2865. v = this.layouts_by_index[u];
  2866. for (f = 0, l = v.effect_types.length; f < l; f++) {
  2867. d = v.effect_types[f];
  2868. d.shaderindex = this.glwrap.getShaderIndex(d.id)
  2869. }
  2870. for (f = 0, l = v.layers.length; f < l; f++) {
  2871. m = v.layers[f];
  2872. for (c = 0, h = m.effect_types.length; c < h; c++) {
  2873. d = m.effect_types[c];
  2874. d.shaderindex = this.glwrap.getShaderIndex(d.id);
  2875. this.uses_background_blending = this.uses_background_blending || this.glwrap.programUsesDest(d.shaderindex)
  2876. }
  2877. }
  2878. }
  2879. } else {
  2880. if (this.fullscreen_mode > 0 && this.isDirectCanvas) {
  2881. this.canvas = null;
  2882. document.oncontextmenu = function(e) {
  2883. return false
  2884. };
  2885. document.onselectstart = function(e) {
  2886. return false
  2887. };
  2888. this.ctx = AppMobi["canvas"]["getContext"]("2d");
  2889. try {
  2890. this.ctx["samplingMode"] = this.linearSampling ? "smooth" : "sharp";
  2891. this.ctx["globalScale"] = 1;
  2892. this.ctx["HTML5CompatibilityMode"] = true;
  2893. this.ctx["imageSmoothingEnabled"] = this.linearSampling
  2894. } catch (o) {}
  2895. if (this.width !== 0 && this.height !== 0) {
  2896. this.ctx.width = this.width;
  2897. this.ctx.height = this.height
  2898. }
  2899. }
  2900. if (!this.ctx) {
  2901. if (this.isCocoonJs) {
  2902. n = {
  2903. antialias: !!this.linearSampling
  2904. };
  2905. this.ctx = e.getContext("2d", n)
  2906. } else this.ctx = e.getContext("2d");
  2907. this.ctx["webkitImageSmoothingEnabled"] = this.linearSampling;
  2908. this.ctx["mozImageSmoothingEnabled"] = this.linearSampling;
  2909. this.ctx["msImageSmoothingEnabled"] = this.linearSampling;
  2910. this.ctx["imageSmoothingEnabled"] = this.linearSampling
  2911. }
  2912. this.overlay_canvas = null;
  2913. this.overlay_ctx = null
  2914. }
  2915. this.tickFunc = function() {
  2916. t.tick()
  2917. };
  2918. if (window != window.top && !this.isDomFree && !this.isWindows8App) {
  2919. document.addEventListener("mousedown", function() {
  2920. window.focus()
  2921. }, true);
  2922. document.addEventListener("touchstart", function() {
  2923. window.focus()
  2924. }, true)
  2925. }
  2926. if (typeof cr_is_preview !== "undefined") {
  2927. if (this.isCocoonJs) console.log("[Construct 2] In preview-over-wifi via CocoonJS mode");
  2928. if (window.location.search.indexOf("continuous") > -1) {
  2929. cr.logexport("Reloading for continuous preview");
  2930. this.loadFromSlot = "__c2_continuouspreview";
  2931. this.suspendDrawing = true
  2932. }
  2933. if (this.pauseOnBlur && !this.isMobile) {
  2934. jQuery(window).focus(function() {
  2935. t["setSuspended"](false)
  2936. });
  2937. jQuery(window).blur(function() {
  2938. t["setSuspended"](true)
  2939. })
  2940. }
  2941. }
  2942. this.go();
  2943. this.extra = {};
  2944. cr.seal(this)
  2945. }
  2946. function l(e) {
  2947. var t = e.target.result;
  2948. console.log("Save:" + t);
  2949. t.createObjectStore("saves", {
  2950. keyPath: "slot"
  2951. })
  2952. }
  2953. function c(e, t, n, r) {
  2954. console.log("IndexedDB_WriteSlot");
  2955. var i = indexedDB.open("_C2SaveStates");
  2956. i.onupgradeneeded = l;
  2957. i.onerror = r;
  2958. i.onsuccess = function(i) {
  2959. var s = i.target.result;
  2960. s.onerror = r;
  2961. var o = s.transaction(["saves"], "readwrite");
  2962. var u = o.objectStore("saves");
  2963. var a = u.put({
  2964. slot: e,
  2965. data: t
  2966. });
  2967. a.onsuccess = n
  2968. }
  2969. }
  2970. function h(e, t, n) {
  2971. var r = indexedDB.open("_C2SaveStates");
  2972. r.onupgradeneeded = l;
  2973. r.onerror = n;
  2974. r.onsuccess = function(r) {
  2975. var i = r.target.result;
  2976. i.onerror = n;
  2977. var s = i.transaction(["saves"]);
  2978. var o = s.objectStore("saves");
  2979. var u = o.get(e);
  2980. u.onsuccess = function(e) {
  2981. if (u.result) t(u.result["data"]);
  2982. else t(null)
  2983. }
  2984. }
  2985. }
  2986. function p() {
  2987. cr.logexport("Reloading for continuous preview");
  2988. if (!!window["c2cocoonjs"]) {
  2989. CocoonJS["App"]["reload"]()
  2990. } else {
  2991. if (window.location.search.indexOf("continuous") > -1) window.location.reload(true);
  2992. else window.location = window.location + "?continuous"
  2993. }
  2994. }
  2995. function d(e) {
  2996. var t, n = {};
  2997. for (t in e) {
  2998. if (e.hasOwnProperty(t)) {
  2999. if (e[t] instanceof cr.ObjectSet) continue;
  3000. if (typeof e[t].c2userdata !== "undefined") continue;
  3001. n[t] = e[t]
  3002. }
  3003. }
  3004. return n
  3005. }
  3006. var t = false;
  3007. e.prototype["setSize"] = function(e, t) {
  3008. var n = this.hideAddressBar && this.isiPhone && !navigator["standalone"] && !this.isDomFree && !this.isPhoneGap;
  3009. var r = 0;
  3010. if (n) {
  3011. if (this.isiPhone) r = 60;
  3012. else if (this.isAndroid) r = 56;
  3013. t += r
  3014. }
  3015. var i = 0,
  3016. s = 0;
  3017. var o = 0,
  3018. u = 0,
  3019. a = 0;
  3020. var f = this.fullscreen_mode;
  3021. var l = document["mozFullScreen"] || document["webkitIsFullScreen"] || !!document["msFullscreenElement"] || document["fullScreen"] || this.isNodeFullscreen;
  3022. if (l && this.fullscreen_scaling > 0) f = this.fullscreen_scaling;
  3023. if (f >= 4) {
  3024. var c = this.original_width / this.original_height;
  3025. var h = e / t;
  3026. if (h > c) {
  3027. o = t * c;
  3028. if (f === 5) {
  3029. a = o / this.original_width;
  3030. if (a > 1) a = Math.floor(a);
  3031. else if (a < 1) a = 1 / Math.ceil(1 / a);
  3032. o = this.original_width * a;
  3033. u = this.original_height * a;
  3034. i = (e - o) / 2;
  3035. s = (t - u) / 2;
  3036. e = o;
  3037. t = u
  3038. } else {
  3039. i = (e - o) / 2;
  3040. e = o
  3041. }
  3042. } else {
  3043. u = e / c;
  3044. if (f === 5) {
  3045. a = u / this.original_height;
  3046. if (a > 1) a = Math.floor(a);
  3047. else if (a < 1) a = 1 / Math.ceil(1 / a);
  3048. o = this.original_width * a;
  3049. u = this.original_height * a;
  3050. i = (e - o) / 2;
  3051. s = (t - u) / 2;
  3052. e = o;
  3053. t = u
  3054. } else {
  3055. s = (t - u) / 2;
  3056. t = u
  3057. }
  3058. } if (l && !this.isNodeWebkit) {
  3059. i = 0;
  3060. s = 0
  3061. }
  3062. i = Math.floor(i);
  3063. s = Math.floor(s);
  3064. e = Math.floor(e);
  3065. t = Math.floor(t)
  3066. } else if (this.isNodeWebkit && this.isNodeFullscreen && this.fullscreen_mode_set === 0) {
  3067. i = Math.floor((e - this.original_width) / 2);
  3068. s = Math.floor((t - this.original_height) / 2);
  3069. e = this.original_width;
  3070. t = this.original_height
  3071. }
  3072. if (this.isRetina && this.isiPad && this.devicePixelRatio > 1) {
  3073. if (e >= 1024) e = 1023;
  3074. if (t >= 1024) t = 1023
  3075. }
  3076. var p = this.devicePixelRatio;
  3077. this.width = e * p;
  3078. this.height = t * p;
  3079. this.redraw = true;
  3080. if (this.canvasdiv && !this.isDomFree) {
  3081. jQuery(this.canvasdiv).css({
  3082. width: e + "px",
  3083. height: t + "px",
  3084. "margin-left": i,
  3085. "margin-top": s
  3086. });
  3087. if (typeof cr_is_preview !== "undefined") {
  3088. jQuery("#borderwrap").css({
  3089. width: e + "px",
  3090. height: t + "px"
  3091. })
  3092. }
  3093. }
  3094. if (this.canvas) {
  3095. this.canvas.width = e * p;
  3096. this.canvas.height = t * p;
  3097. if (this.isRetina) {
  3098. jQuery(this.canvas).css({
  3099. width: e + "px",
  3100. height: t + "px"
  3101. })
  3102. }
  3103. }
  3104. if (this.overlay_canvas) {
  3105. this.overlay_canvas.width = e;
  3106. this.overlay_canvas.height = t
  3107. }
  3108. if (this.glwrap) this.glwrap.setSize(e, t);
  3109. if (this.isDirectCanvas && this.ctx) {
  3110. this.ctx.width = e;
  3111. this.ctx.height = t
  3112. }
  3113. if (this.ctx) {
  3114. this.ctx["webkitImageSmoothingEnabled"] = this.linearSampling;
  3115. this.ctx["mozImageSmoothingEnabled"] = this.linearSampling;
  3116. this.ctx["msImageSmoothingEnabled"] = this.linearSampling;
  3117. this.ctx["imageSmoothingEnabled"] = this.linearSampling
  3118. }
  3119. if (n && r > 0) {
  3120. window.setTimeout(function() {
  3121. window.scrollTo(0, 1)
  3122. }, 100)
  3123. }
  3124. };
  3125. e.prototype.onContextLost = function() {
  3126. this.is_WebGL_context_lost = true;
  3127. var e, t, n;
  3128. for (e = 0, t = this.types_by_index.length; e < t; e++) {
  3129. n = this.types_by_index[e];
  3130. if (n.onLostWebGLContext) n.onLostWebGLContext()
  3131. }
  3132. };
  3133. e.prototype.onContextRestored = function() {
  3134. this.is_WebGL_context_lost = false;
  3135. var e, t, n;
  3136. for (e = 0, t = this.types_by_index.length; e < t; e++) {
  3137. n = this.types_by_index[e];
  3138. if (n.onRestoreWebGLContext) n.onRestoreWebGLContext()
  3139. }
  3140. };
  3141. e.prototype.positionOverlayCanvas = function() {
  3142. if (this.isDomFree) return;
  3143. var e = document["mozFullScreen"] || document["webkitIsFullScreen"] || document["fullScreen"] || !!document["msFullscreenElement"] || this.isNodeFullscreen;
  3144. var t = e ? jQuery(this.canvas).offset() : jQuery(this.canvas).position();
  3145. t.position = "absolute";
  3146. jQuery(this.overlay_canvas).css(t)
  3147. };
  3148. var n = window["cancelAnimationFrame"] || window["mozCancelAnimationFrame"] || window["webkitCancelAnimationFrame"] || window["msCancelAnimationFrame"] || window["oCancelAnimationFrame"];
  3149. e.prototype["setSuspended"] = function(e) {
  3150. var t, r;
  3151. if (e && !this.isSuspended) {
  3152. cr.logexport("[Construct 2] Suspending");
  3153. this.isSuspended = true;
  3154. if (this.raf_id !== 0 && n) n(this.raf_id);
  3155. if (this.timeout_id !== 0) clearTimeout(this.timeout_id);
  3156. for (t = 0, r = this.suspend_events.length; t < r; t++) this.suspend_events[t](true)
  3157. } else if (!e && this.isSuspended) {
  3158. cr.logexport("[Construct 2] Resuming");
  3159. this.isSuspended = false;
  3160. this.last_tick_time = cr.performance_now();
  3161. this.last_fps_time = cr.performance_now();
  3162. this.framecount = 0;
  3163. this.logictime = 0;
  3164. for (t = 0, r = this.suspend_events.length; t < r; t++) this.suspend_events[t](false);
  3165. this.tick()
  3166. }
  3167. };
  3168. e.prototype.addSuspendCallback = function(e) {
  3169. this.suspend_events.push(e)
  3170. };
  3171. e.prototype.load = function() {
  3172. var e = cr.getProjectModel();
  3173. this.name = e[0];
  3174. this.first_layout = e[1];
  3175. this.fullscreen_mode = e[11];
  3176. this.fullscreen_mode_set = e[11];
  3177. if (this.isDomFree && (e[11] >= 4 || e[11] === 0)) {
  3178. cr.logexport("[Construct 2] Letterbox scale fullscreen modes are not supported on this platform - falling back to 'Scale outer'");
  3179. this.fullscreen_mode = 3;
  3180. this.fullscreen_mode_set = 3
  3181. }
  3182. this.uses_loader_layout = e[17];
  3183. this.loaderstyle = e[18];
  3184. if (this.loaderstyle === 0) {
  3185. this.loaderlogo = new Image;
  3186. this.loaderlogo.src = "loading-logo.png"
  3187. }
  3188. this.next_uid = e[20];
  3189. this.system = new cr.system_object(this);
  3190. var t, n, r, i, s, o, u, a, f, l, c;
  3191. var h, p;
  3192. for (t = 0, n = e[2].length; t < n; t++) {
  3193. a = e[2][t];
  3194. cr.add_common_aces(a);
  3195. h = new a[0](this);
  3196. h.singleglobal = a[1];
  3197. h.is_world = a[2];
  3198. h.must_predraw = a[9];
  3199. if (h.onCreate) h.onCreate();
  3200. cr.seal(h);
  3201. this.plugins.push(h)
  3202. }
  3203. e = cr.getProjectModel();
  3204. for (t = 0, n = e[3].length; t < n; t++) {
  3205. a = e[3][t];
  3206. p = a[1];
  3207. h = null;
  3208. for (r = 0, i = this.plugins.length; r < i; r++) {
  3209. if (this.plugins[r] instanceof p) {
  3210. h = this.plugins[r];
  3211. break
  3212. }
  3213. }
  3214. var d = new h.Type(h);
  3215. d.name = a[0];
  3216. d.is_family = a[2];
  3217. d.instvar_sids = a[3].slice(0);
  3218. d.vars_count = a[3].length;
  3219. d.behs_count = a[4];
  3220. d.fx_count = a[5];
  3221. d.sid = a[11];
  3222. if (d.is_family) {
  3223. d.members = [];
  3224. d.family_index = this.family_count++;
  3225. d.families = null
  3226. } else {
  3227. d.members = null;
  3228. d.family_index = -1;
  3229. d.families = []
  3230. }
  3231. d.family_var_map = null;
  3232. d.family_beh_map = null;
  3233. d.family_fx_map = null;
  3234. d.is_contained = false;
  3235. d.container = null;
  3236. if (a[6]) {
  3237. d.texture_file = a[6][0];
  3238. d.texture_filesize = a[6][1];
  3239. d.texture_pixelformat = a[6][2]
  3240. } else {
  3241. d.texture_file = null;
  3242. d.texture_filesize = 0;
  3243. d.texture_pixelformat = 0
  3244. } if (a[7]) {
  3245. d.animations = a[7]
  3246. } else {
  3247. d.animations = null
  3248. }
  3249. d.index = t;
  3250. d.instances = [];
  3251. d.deadCache = [];
  3252. d.solstack = [new cr.selection(d)];
  3253. d.cur_sol = 0;
  3254. d.default_instance = null;
  3255. d.stale_iids = true;
  3256. d.updateIIDs = cr.type_updateIIDs;
  3257. d.getFirstPicked = cr.type_getFirstPicked;
  3258. d.getPairedInstance = cr.type_getPairedInstance;
  3259. d.getCurrentSol = cr.type_getCurrentSol;
  3260. d.pushCleanSol = cr.type_pushCleanSol;
  3261. d.pushCopySol = cr.type_pushCopySol;
  3262. d.popSol = cr.type_popSol;
  3263. d.getBehaviorByName = cr.type_getBehaviorByName;
  3264. d.getBehaviorIndexByName = cr.type_getBehaviorIndexByName;
  3265. d.getEffectIndexByName = cr.type_getEffectIndexByName;
  3266. d.applySolToContainer = cr.type_applySolToContainer;
  3267. d.extra = {};
  3268. d.toString = cr.type_toString;
  3269. d.behaviors = [];
  3270. for (r = 0, i = a[8].length; r < i; r++) {
  3271. f = a[8][r];
  3272. var v = f[1];
  3273. var m = null;
  3274. for (s = 0, o = this.behaviors.length; s < o; s++) {
  3275. if (this.behaviors[s] instanceof v) {
  3276. m = this.behaviors[s];
  3277. break
  3278. }
  3279. }
  3280. if (!m) {
  3281. m = new v(this);
  3282. m.my_instances = new cr.ObjectSet;
  3283. if (m.onCreate) m.onCreate();
  3284. cr.seal(m);
  3285. this.behaviors.push(m)
  3286. }
  3287. var g = new m.Type(m, d);
  3288. g.name = f[0];
  3289. g.sid = f[2];
  3290. g.onCreate();
  3291. cr.seal(g);
  3292. d.behaviors.push(g)
  3293. }
  3294. d.global = a[9];
  3295. d.isOnLoaderLayout = a[10];
  3296. d.effect_types = [];
  3297. for (r = 0, i = a[12].length; r < i; r++) {
  3298. d.effect_types.push({
  3299. id: a[12][r][0],
  3300. name: a[12][r][1],
  3301. shaderindex: -1,
  3302. active: true,
  3303. index: r
  3304. })
  3305. }
  3306. if (!this.uses_loader_layout || d.is_family || d.isOnLoaderLayout || !h.is_world) {
  3307. d.onCreate();
  3308. cr.seal(d)
  3309. }
  3310. if (d.name) this.types[d.name] = d;
  3311. this.types_by_index.push(d);
  3312. if (h.singleglobal) {
  3313. var y = new h.Instance(d);
  3314. y.uid = this.next_uid++;
  3315. y.puid = this.next_puid++;
  3316. y.iid = 0;
  3317. y.get_iid = cr.inst_get_iid;
  3318. y.toString = cr.inst_toString;
  3319. y.properties = a[13];
  3320. y.onCreate();
  3321. cr.seal(y);
  3322. d.instances.push(y);
  3323. this.objectsByUid[y.uid.toString()] = y
  3324. }
  3325. }
  3326. for (t = 0, n = e[4].length; t < n; t++) {
  3327. var b = e[4][t];
  3328. var w = this.types_by_index[b[0]];
  3329. var E;
  3330. for (r = 1, i = b.length; r < i; r++) {
  3331. E = this.types_by_index[b[r]];
  3332. E.families.push(w);
  3333. w.members.push(E)
  3334. }
  3335. }
  3336. for (t = 0, n = e[22].length; t < n; t++) {
  3337. var S = e[22][t];
  3338. var x = [];
  3339. for (r = 0, i = S.length; r < i; r++) x.push(this.types_by_index[S[r]]);
  3340. for (r = 0, i = x.length; r < i; r++) {
  3341. x[r].is_contained = true;
  3342. x[r].container = x
  3343. }
  3344. }
  3345. if (this.family_count > 0) {
  3346. for (t = 0, n = this.types_by_index.length; t < n; t++) {
  3347. l = this.types_by_index[t];
  3348. if (l.is_family || !l.families.length) continue;
  3349. l.family_var_map = new Array(this.family_count);
  3350. l.family_beh_map = new Array(this.family_count);
  3351. l.family_fx_map = new Array(this.family_count);
  3352. var T = [];
  3353. var N = 0;
  3354. var C = 0;
  3355. var k = 0;
  3356. for (r = 0, i = l.families.length; r < i; r++) {
  3357. c = l.families[r];
  3358. l.family_var_map[c.family_index] = N;
  3359. N += c.vars_count;
  3360. l.family_beh_map[c.family_index] = C;
  3361. C += c.behs_count;
  3362. l.family_fx_map[c.family_index] = k;
  3363. k += c.fx_count;
  3364. for (s = 0, o = c.effect_types.length; s < o; s++) T.push(cr.shallowCopy({}, c.effect_types[s]))
  3365. }
  3366. l.effect_types = T.concat(l.effect_types);
  3367. for (r = 0, i = l.effect_types.length; r < i; r++) l.effect_types[r].index = r
  3368. }
  3369. }
  3370. for (t = 0, n = e[5].length; t < n; t++) {
  3371. a = e[5][t];
  3372. var L = new cr.layout(this, a);
  3373. cr.seal(L);
  3374. this.layouts[L.name] = L;
  3375. this.layouts_by_index.push(L)
  3376. }
  3377. for (t = 0, n = e[6].length; t < n; t++) {
  3378. a = e[6][t];
  3379. var A = new cr.eventsheet(this, a);
  3380. cr.seal(A);
  3381. this.eventsheets[A.name] = A;
  3382. this.eventsheets_by_index.push(A)
  3383. }
  3384. for (t = 0, n = this.eventsheets_by_index.length; t < n; t++) this.eventsheets_by_index[t].postInit();
  3385. for (t = 0, n = this.triggers_to_postinit.length; t < n; t++) this.triggers_to_postinit[t].postInit();
  3386. this.triggers_to_postinit.length = 0;
  3387. this.files_subfolder = e[7];
  3388. this.pixel_rounding = e[8];
  3389. this.original_width = e[9];
  3390. this.original_height = e[10];
  3391. this.aspect_scale = 1;
  3392. this.enableWebGL = e[12];
  3393. this.linearSampling = e[13];
  3394. this.clearBackground = e[14];
  3395. this.versionstr = e[15];
  3396. var O = e[16];
  3397. if (O === 2) O = this.isiPhone ? 1 : 0;
  3398. this.useiOSRetina = O !== 0;
  3399. this.hideAddressBar = e[19];
  3400. this.pauseOnBlur = e[21];
  3401. this.start_time = Date.now()
  3402. };
  3403. e.prototype.findWaitingTexture = function(e) {
  3404. var t, n;
  3405. for (t = 0, n = this.wait_for_textures.length; t < n; t++) {
  3406. if (this.wait_for_textures[t].cr_src === e) return this.wait_for_textures[t]
  3407. }
  3408. return null
  3409. };
  3410. e.prototype.areAllTexturesLoaded = function() {
  3411. var e = 0;
  3412. var t = 0;
  3413. var n = true;
  3414. var r, i;
  3415. for (r = 0, i = this.wait_for_textures.length; r < i; r++) {
  3416. var s = this.wait_for_textures[r].cr_filesize;
  3417. if (!s || s <= 0) s = 5e4;
  3418. e += s;
  3419. if (this.wait_for_textures[r].complete || this.wait_for_textures[r]["loaded"]) t += s;
  3420. else n = false
  3421. }
  3422. if (e == 0) this.progress = 0;
  3423. else this.progress = t / e;
  3424. return n
  3425. };
  3426. e.prototype.go = function() {
  3427. if (!this.ctx && !this.glwrap) return;
  3428. var e = this.ctx || this.overlay_ctx;
  3429. if (this.overlay_canvas) this.positionOverlayCanvas();
  3430. this.progress = 0;
  3431. this.last_progress = -1;
  3432. if (this.areAllTexturesLoaded()) this.go_textures_done();
  3433. else {
  3434. var t = Date.now() - this.start_time;
  3435. var n = 1;
  3436. if (this.isTizen) n = this.devicePixelRatio;
  3437. if (e) {
  3438. if (this.loaderstyle !== 3 && t >= 500 && this.last_progress != this.progress) {
  3439. e.clearRect(0, 0, this.width, this.height);
  3440. var r = this.width / (2 * n);
  3441. var i = this.height / (2 * n);
  3442. var s = this.loaderstyle === 0 && this.loaderlogo.complete;
  3443. var o = 40;
  3444. var u = 0;
  3445. var a = 80;
  3446. if (s) {
  3447. a = this.loaderlogo.width;
  3448. o = a / 2;
  3449. u = this.loaderlogo.height / 2;
  3450. e.drawImage(this.loaderlogo, cr.floor(r - o), cr.floor(i - u))
  3451. }
  3452. if (this.loaderstyle <= 1) {
  3453. i += u + (s ? 12 : 0);
  3454. r -= o;
  3455. r = cr.floor(r) + .5;
  3456. i = cr.floor(i) + .5;
  3457. e.fillStyle = "DodgerBlue";
  3458. e.fillRect(r, i, Math.floor(a * this.progress), 6);
  3459. e.strokeStyle = "black";
  3460. e.strokeRect(r, i, a, 6);
  3461. e.strokeStyle = "white";
  3462. e.strokeRect(r - 1, i - 1, a + 2, 8)
  3463. } else if (this.loaderstyle === 2) {
  3464. e.font = "12pt Arial";
  3465. e.fillStyle = "#999";
  3466. e.textBaseLine = "middle";
  3467. var f = Math.round(this.progress * 100) + "%";
  3468. var l = e.measureText ? e.measureText(f) : null;
  3469. var c = l ? l.width : 0;
  3470. e.fillText(f, r - c / 2, i)
  3471. }
  3472. }
  3473. this.last_progress = this.progress
  3474. }
  3475. setTimeout(function(e) {
  3476. return function() {
  3477. e.go()
  3478. }
  3479. }(this), 100)
  3480. }
  3481. };
  3482. e.prototype.go_textures_done = function() {
  3483. if (this.overlay_canvas) {
  3484. this.canvas.parentNode.removeChild(this.overlay_canvas);
  3485. this.overlay_ctx = null;
  3486. this.overlay_canvas = null
  3487. }
  3488. this.start_time = Date.now();
  3489. this.last_fps_time = cr.performance_now();
  3490. var e, t, n;
  3491. if (this.uses_loader_layout) {
  3492. for (e = 0, t = this.types_by_index.length; e < t; e++) {
  3493. n = this.types_by_index[e];
  3494. if (!n.is_family && !n.isOnLoaderLayout && n.plugin.is_world) {
  3495. n.onCreate();
  3496. cr.seal(n)
  3497. }
  3498. }
  3499. } else this.isloading = false;
  3500. for (e = 0, t = this.layouts_by_index.length; e < t; e++) {
  3501. this.layouts_by_index[e].createGlobalNonWorlds()
  3502. }
  3503. if (this.fullscreen_mode >= 2) {
  3504. var r = this.original_width / this.original_height;
  3505. var i = this.width / this.height;
  3506. if (this.fullscreen_mode !== 2 && i > r || this.fullscreen_mode === 2 && i < r) this.aspect_scale = this.height / this.original_height;
  3507. else this.aspect_scale = this.width / this.original_width
  3508. }
  3509. if (this.first_layout) this.layouts[this.first_layout].startRunning();
  3510. else this.layouts_by_index[0].startRunning(); if (!this.uses_loader_layout) {
  3511. this.loadingprogress = 1;
  3512. this.trigger(cr.system_object.prototype.cnds.OnLoadFinished, null)
  3513. }
  3514. this.tick();
  3515. if (this.isDirectCanvas) AppMobi["webview"]["execute"]("onGameReady();")
  3516. };
  3517. var r = window["requestAnimationFrame"] || window["mozRequestAnimationFrame"] || window["webkitRequestAnimationFrame"] || window["msRequestAnimationFrame"] || window["oRequestAnimationFrame"];
  3518. e.prototype.tick = function() {
  3519. if (!this.running_layout) return;
  3520. var e = cr.performance_now();
  3521. if (!this.isDomFree && window != window.top) {
  3522. var t = this.fullscreen_mode;
  3523. var n = document["mozFullScreen"] || document["webkitIsFullScreen"] || document["fullScreen"] || !!document["msFullscreenElement"] || this.isNodeFullscreen;
  3524. if (n && this.fullscreen_scaling > 0) t = this.fullscreen_scaling;
  3525. if (t > 0) {
  3526. var i = window.innerWidth;
  3527. var s = window.innerHeight;
  3528. if (this.lastwidth !== i || this.lastheight !== s) {
  3529. this.lastwidth = i;
  3530. this.lastheight = s;
  3531. this["setSize"](i, s)
  3532. }
  3533. }
  3534. }
  3535. if (this.isloading) {
  3536. var o = this.areAllTexturesLoaded();
  3537. this.loadingprogress = this.progress;
  3538. if (o) {
  3539. this.isloading = false;
  3540. this.progress = 1;
  3541. this.trigger(cr.system_object.prototype.cnds.OnLoadFinished, null)
  3542. }
  3543. }
  3544. this.logic();
  3545. if ((this.redraw || this.isCocoonJs) && !this.is_WebGL_context_lost && !this.suspendDrawing) {
  3546. this.redraw = false;
  3547. if (this.glwrap) this.drawGL();
  3548. else this.draw(); if (this.snapshotCanvas) {
  3549. if (this.canvas && this.canvas.toDataURL) {
  3550. this.snapshotData = this.canvas.toDataURL(this.snapshotCanvas[0], this.snapshotCanvas[1]);
  3551. this.trigger(cr.system_object.prototype.cnds.OnCanvasSnapshot, null)
  3552. }
  3553. this.snapshotCanvas = null
  3554. }
  3555. }
  3556. if (!this.hit_breakpoint) {
  3557. this.tickcount++;
  3558. this.execcount++;
  3559. this.framecount++
  3560. }
  3561. this.logictime += cr.performance_now() - e;
  3562. if (this.isSuspended) return;
  3563. if (r) this.raf_id = r(this.tickFunc, this.canvas);
  3564. else {
  3565. this.timeout_id = setTimeout(this.tickFunc, this.isMobile ? 1 : 16)
  3566. }
  3567. };
  3568. e.prototype.logic = function() {
  3569. orientationListener();
  3570. var e, t, n, r, i, s, o, u, a;
  3571. var f = cr.performance_now();
  3572. if (f - this.last_fps_time >= 1e3) {
  3573. this.last_fps_time += 1e3;
  3574. this.fps = this.framecount;
  3575. this.framecount = 0;
  3576. this.cpuutilisation = this.logictime;
  3577. this.logictime = 0
  3578. }
  3579. if (this.measuring_dt) {
  3580. if (this.last_tick_time !== 0) {
  3581. var l = f - this.last_tick_time;
  3582. if (l === 0 && !this.isDebug) {
  3583. this.zeroDtCount++;
  3584. if (this.zeroDtCout >= 10) this.measuring_dt = false;
  3585. this.dt1 = 1 / 60
  3586. } else {
  3587. this.dt1 = l / 1e3;
  3588. if (this.dt1 > .5) this.dt1 = 0;
  3589. else if (this.dt1 > .1) this.dt1 = .1
  3590. }
  3591. }
  3592. this.last_tick_time = f
  3593. }
  3594. this.dt = this.dt1 * this.timescale;
  3595. this.kahanTime.add(this.dt);
  3596. var c = document["mozFullScreen"] || document["webkitIsFullScreen"] || document["fullScreen"] || !!document["msFullscreenElement"] || this.isNodeFullscreen;
  3597. if (this.fullscreen_mode >= 2 || c && this.fullscreen_scaling > 0) {
  3598. var h = this.original_width / this.original_height;
  3599. var p = this.width / this.height;
  3600. var d = this.fullscreen_mode;
  3601. if (c && this.fullscreen_scaling > 0) d = this.fullscreen_scaling;
  3602. if (d !== 2 && p > h || d === 2 && p < h) {
  3603. this.aspect_scale = this.height / this.original_height
  3604. } else {
  3605. this.aspect_scale = this.width / this.original_width
  3606. } if (this.running_layout) {
  3607. this.running_layout.scrollToX(this.running_layout.scrollX);
  3608. this.running_layout.scrollToY(this.running_layout.scrollY)
  3609. }
  3610. } else this.aspect_scale = 1;
  3611. this.ClearDeathRow();
  3612. this.isInOnDestroy++;
  3613. this.system.runWaits();
  3614. this.isInOnDestroy--;
  3615. this.ClearDeathRow();
  3616. this.isInOnDestroy++;
  3617. for (e = 0, t = this.types_by_index.length; e < t; e++) {
  3618. o = this.types_by_index[e];
  3619. if (o.is_family || !o.behaviors.length && !o.families.length) continue;
  3620. for (n = 0, r = o.instances.length; n < r; n++) {
  3621. u = o.instances[n];
  3622. for (i = 0, s = u.behavior_insts.length; i < s; i++) {
  3623. u.behavior_insts[i].tick()
  3624. }
  3625. }
  3626. }
  3627. for (e = 0, t = this.types_by_index.length; e < t; e++) {
  3628. o = this.types_by_index[e];
  3629. if (o.is_family || !o.behaviors.length && !o.families.length) continue;
  3630. for (n = 0, r = o.instances.length; n < r; n++) {
  3631. u = o.instances[n];
  3632. for (i = 0, s = u.behavior_insts.length; i < s; i++) {
  3633. a = u.behavior_insts[i];
  3634. if (a.posttick) a.posttick()
  3635. }
  3636. }
  3637. }
  3638. var v = this.objects_to_tick.valuesRef();
  3639. for (e = 0, t = v.length; e < t; e++) v[e].tick();
  3640. this.isInOnDestroy--;
  3641. this.handleSaveLoad();
  3642. e = 0;
  3643. while (this.changelayout && e++ < 10) {
  3644. this.doChangeLayout(this.changelayout)
  3645. }
  3646. for (e = 0, t = this.eventsheets_by_index.length; e < t; e++) this.eventsheets_by_index[e].hasRun = false;
  3647. if (this.running_layout.event_sheet) this.running_layout.event_sheet.run();
  3648. this.registered_collisions.length = 0;
  3649. this.layout_first_tick = false;
  3650. this.isInOnDestroy++;
  3651. for (e = 0, t = this.types_by_index.length; e < t; e++) {
  3652. o = this.types_by_index[e];
  3653. if (o.is_family || !o.behaviors.length && !o.families.length) continue;
  3654. for (n = 0, r = o.instances.length; n < r; n++) {
  3655. var u = o.instances[n];
  3656. for (i = 0, s = u.behavior_insts.length; i < s; i++) {
  3657. a = u.behavior_insts[i];
  3658. if (a.tick2) a.tick2()
  3659. }
  3660. }
  3661. }
  3662. v = this.objects_to_tick2.valuesRef();
  3663. for (e = 0, t = v.length; e < t; e++) v[e].tick2();
  3664. this.isInOnDestroy--
  3665. };
  3666. e.prototype.doChangeLayout = function(e) {
  3667. var t = this.running_layout;
  3668. this.running_layout.stopRunning();
  3669. var n, r, i, s, o, u, a, f, l;
  3670. if (this.glwrap) {
  3671. for (n = 0, r = this.types_by_index.length; n < r; n++) {
  3672. a = this.types_by_index[n];
  3673. if (a.is_family) continue;
  3674. if (a.unloadTextures && (!a.global || a.instances.length === 0) && e.initial_types.indexOf(a) === -1) {
  3675. a.unloadTextures()
  3676. }
  3677. }
  3678. }
  3679. if (t == e) this.system.waits.length = 0;
  3680. e.startRunning();
  3681. for (n = 0, r = this.types_by_index.length; n < r; n++) {
  3682. a = this.types_by_index[n];
  3683. if (!a.global && !a.plugin.singleglobal) continue;
  3684. for (i = 0, s = a.instances.length; i < s; i++) {
  3685. f = a.instances[i];
  3686. if (f.onLayoutChange) f.onLayoutChange();
  3687. if (f.behavior_insts) {
  3688. for (o = 0, u = f.behavior_insts.length; o < u; o++) {
  3689. l = f.behavior_insts[o];
  3690. if (l.onLayoutChange) l.onLayoutChange()
  3691. }
  3692. }
  3693. }
  3694. }
  3695. this.redraw = true;
  3696. this.layout_first_tick = true;
  3697. this.ClearDeathRow()
  3698. };
  3699. e.prototype.tickMe = function(e) {
  3700. this.objects_to_tick.add(e)
  3701. };
  3702. e.prototype.untickMe = function(e) {
  3703. this.objects_to_tick.remove(e)
  3704. };
  3705. e.prototype.tick2Me = function(e) {
  3706. this.objects_to_tick2.add(e)
  3707. };
  3708. e.prototype.untick2Me = function(e) {
  3709. this.objects_to_tick2.remove(e)
  3710. };
  3711. e.prototype.getDt = function(e) {
  3712. if (!e || e.my_timescale === -1) return this.dt;
  3713. return this.dt1 * e.my_timescale
  3714. };
  3715. e.prototype.draw = function() {
  3716. this.running_layout.draw(this.ctx);
  3717. if (this.isDirectCanvas) this.ctx["present"]()
  3718. };
  3719. e.prototype.drawGL = function() {
  3720. this.running_layout.drawGL(this.glwrap);
  3721. this.glwrap.present()
  3722. };
  3723. e.prototype.addDestroyCallback = function(e) {
  3724. if (e) this.destroycallbacks.push(e)
  3725. };
  3726. e.prototype.removeDestroyCallback = function(e) {
  3727. cr.arrayFindRemove(this.destroycallbacks, e)
  3728. };
  3729. e.prototype.getObjectByUID = function(e) {
  3730. return this.objectsByUid[e.toString()]
  3731. };
  3732. e.prototype.DestroyInstance = function(e) {
  3733. var t, n;
  3734. if (!this.deathRow.contains(e)) {
  3735. this.deathRow.add(e);
  3736. if (e.is_contained) {
  3737. for (t = 0, n = e.siblings.length; t < n; t++) {
  3738. this.DestroyInstance(e.siblings[t])
  3739. }
  3740. }
  3741. if (this.isInClearDeathRow) this.deathRow.values_cache.push(e);
  3742. this.isInOnDestroy++;
  3743. this.trigger(Object.getPrototypeOf(e.type.plugin).cnds.OnDestroyed, e);
  3744. this.isInOnDestroy--
  3745. }
  3746. };
  3747. e.prototype.ClearDeathRow = function() {
  3748. var e, t, n, r, i;
  3749. var s, o, u, a, f, l;
  3750. var c, h;
  3751. this.isInClearDeathRow = true;
  3752. for (s = 0, a = this.createRow.length; s < a; s++) {
  3753. e = this.createRow[s];
  3754. n = e.type;
  3755. n.instances.push(e);
  3756. for (o = 0, f = n.families.length; o < f; o++) {
  3757. n.families[o].instances.push(e);
  3758. n.families[o].stale_iids = true
  3759. }
  3760. }
  3761. this.createRow.length = 0;
  3762. var p = this.deathRow.valuesRef();
  3763. for (s = 0; s < p.length; s++) {
  3764. e = p[s];
  3765. n = e.type;
  3766. r = n.instances;
  3767. for (o = 0, f = this.destroycallbacks.length; o < f; o++) this.destroycallbacks[o](e);
  3768. cr.arrayFindRemove(r, e);
  3769. if (e.layer) {
  3770. cr.arrayRemove(e.layer.instances, e.get_zindex());
  3771. e.layer.zindices_stale = true
  3772. }
  3773. for (o = 0, f = n.families.length; o < f; o++) {
  3774. cr.arrayFindRemove(n.families[o].instances, e);
  3775. n.families[o].stale_iids = true
  3776. }
  3777. if (e.behavior_insts) {
  3778. for (o = 0, f = e.behavior_insts.length; o < f; o++) {
  3779. i = e.behavior_insts[o];
  3780. if (i.onDestroy) i.onDestroy();
  3781. i.behavior.my_instances.remove(e)
  3782. }
  3783. }
  3784. this.objects_to_tick.remove(e);
  3785. this.objects_to_tick2.remove(e);
  3786. for (o = 0, f = this.system.waits.length; o < f; o++) {
  3787. c = this.system.waits[o];
  3788. if (c.sols.hasOwnProperty(n.index)) cr.arrayFindRemove(c.sols[n.index].insts, e);
  3789. if (!n.is_family) {
  3790. for (u = 0, l = n.families.length; u < l; u++) {
  3791. h = n.families[u];
  3792. if (c.sols.hasOwnProperty(h.index)) cr.arrayFindRemove(c.sols[h.index].insts, e)
  3793. }
  3794. }
  3795. }
  3796. if (e.onDestroy) e.onDestroy();
  3797. if (this.objectsByUid.hasOwnProperty(e.uid.toString())) delete this.objectsByUid[e.uid.toString()];
  3798. this.objectcount--;
  3799. if (n.deadCache.length < 64) n.deadCache.push(e);
  3800. n.stale_iids = true
  3801. }
  3802. if (!this.deathRow.isEmpty()) this.redraw = true;
  3803. this.deathRow.clear();
  3804. this.isInClearDeathRow = false
  3805. };
  3806. e.prototype.createInstance = function(e, t, n, r) {
  3807. if (e.is_family) {
  3808. var i = cr.floor(Math.random() * e.members.length);
  3809. return this.createInstance(e.members[i], t, n, r)
  3810. }
  3811. if (!e.default_instance) {
  3812. return null
  3813. }
  3814. return this.createInstanceFromInit(e.default_instance, t, false, n, r, false)
  3815. };
  3816. var i = [];
  3817. e.prototype.createInstanceFromInit = function(e, t, n, r, s, o) {
  3818. var u, a, f, l, c, h, p, d;
  3819. if (!e) return null;
  3820. var v = this.types_by_index[e[1]];
  3821. var m = v.plugin.is_world;
  3822. if (this.isloading && m && !v.isOnLoaderLayout) return null;
  3823. if (m && !this.glwrap && e[0][11] === 11) return null;
  3824. var g = t;
  3825. if (!m) t = null;
  3826. var y;
  3827. if (v.deadCache.length) {
  3828. y = v.deadCache.pop();
  3829. y.recycled = true;
  3830. v.plugin.Instance.call(y, v)
  3831. } else {
  3832. y = new v.plugin.Instance(v);
  3833. y.recycled = false
  3834. } if (n && !o) y.uid = e[2];
  3835. else y.uid = this.next_uid++;
  3836. this.objectsByUid[y.uid.toString()] = y;
  3837. y.puid = this.next_puid++;
  3838. y.iid = v.instances.length;
  3839. for (u = 0, a = this.createRow.length; u < a; ++u) {
  3840. if (this.createRow[u].type === v) y.iid++
  3841. }
  3842. y.get_iid = cr.inst_get_iid;
  3843. var b = e[3];
  3844. if (y.recycled) {
  3845. cr.wipe(y.extra)
  3846. } else {
  3847. y.extra = {};
  3848. if (typeof cr_is_preview !== "undefined") {
  3849. y.instance_var_names = [];
  3850. y.instance_var_names.length = b.length;
  3851. for (u = 0, a = b.length; u < a; u++) y.instance_var_names[u] = b[u][1]
  3852. }
  3853. y.instance_vars = [];
  3854. y.instance_vars.length = b.length
  3855. }
  3856. for (u = 0, a = b.length; u < a; u++) y.instance_vars[u] = b[u][0];
  3857. if (m) {
  3858. var w = e[0];
  3859. y.x = cr.is_undefined(r) ? w[0] : r;
  3860. y.y = cr.is_undefined(s) ? w[1] : s;
  3861. y.z = w[2];
  3862. y.width = w[3];
  3863. y.height = w[4];
  3864. y.depth = w[5];
  3865. y.angle = w[6];
  3866. y.opacity = w[7];
  3867. y.hotspotX = w[8];
  3868. y.hotspotY = w[9];
  3869. y.blend_mode = w[10];
  3870. h = w[11];
  3871. if (!this.glwrap && v.effect_types.length) y.blend_mode = h;
  3872. y.compositeOp = cr.effectToCompositeOp(y.blend_mode);
  3873. if (this.gl) cr.setGLBlend(y, y.blend_mode, this.gl);
  3874. if (y.recycled) {
  3875. for (u = 0, a = w[12].length; u < a; u++) {
  3876. for (f = 0, l = w[12][u].length; f < l; f++) y.effect_params[u][f] = w[12][u][f]
  3877. }
  3878. y.bbox.set(0, 0, 0, 0);
  3879. y.bquad.set_from_rect(y.bbox);
  3880. y.bbox_changed_callbacks.length = 0
  3881. } else {
  3882. y.effect_params = w[12].slice(0);
  3883. for (u = 0, a = y.effect_params.length; u < a; u++) y.effect_params[u] = w[12][u].slice(0);
  3884. y.active_effect_types = [];
  3885. y.active_effect_flags = [];
  3886. y.active_effect_flags.length = v.effect_types.length;
  3887. y.bbox = new cr.rect(0, 0, 0, 0);
  3888. y.bquad = new cr.quad;
  3889. y.bbox_changed_callbacks = [];
  3890. y.set_bbox_changed = cr.set_bbox_changed;
  3891. y.add_bbox_changed_callback = cr.add_bbox_changed_callback;
  3892. y.contains_pt = cr.inst_contains_pt;
  3893. y.update_bbox = cr.update_bbox;
  3894. y.get_zindex = cr.inst_get_zindex
  3895. }
  3896. for (u = 0, a = v.effect_types.length; u < a; u++) y.active_effect_flags[u] = true;
  3897. y.updateActiveEffects = cr.inst_updateActiveEffects;
  3898. y.updateActiveEffects();
  3899. y.uses_shaders = !!y.active_effect_types.length;
  3900. y.bbox_changed = true;
  3901. y.visible = true;
  3902. y.my_timescale = -1;
  3903. y.layer = t;
  3904. y.zindex = t.instances.length;
  3905. if (typeof y.collision_poly === "undefined") y.collision_poly = null;
  3906. y.collisionsEnabled = true;
  3907. this.redraw = true
  3908. }
  3909. y.toString = cr.inst_toString;
  3910. var E, S;
  3911. i.length = 0;
  3912. for (u = 0, a = v.families.length; u < a; u++) {
  3913. i.push.apply(i, v.families[u].behaviors)
  3914. }
  3915. i.push.apply(i, v.behaviors);
  3916. if (y.recycled) {
  3917. for (u = 0, a = i.length; u < a; u++) {
  3918. var x = i[u];
  3919. S = y.behavior_insts[u];
  3920. S.recycled = true;
  3921. x.behavior.Instance.call(S, x, y);
  3922. E = e[4][u];
  3923. for (f = 0, l = E.length; f < l; f++) S.properties[f] = E[f];
  3924. S.onCreate();
  3925. x.behavior.my_instances.add(y)
  3926. }
  3927. } else {
  3928. y.behavior_insts = [];
  3929. for (u = 0, a = i.length; u < a; u++) {
  3930. var x = i[u];
  3931. var S = new x.behavior.Instance(x, y);
  3932. S.recycled = false;
  3933. S.properties = e[4][u].slice(0);
  3934. S.onCreate();
  3935. cr.seal(S);
  3936. y.behavior_insts.push(S);
  3937. x.behavior.my_instances.add(y)
  3938. }
  3939. }
  3940. E = e[5];
  3941. if (y.recycled) {
  3942. for (u = 0, a = E.length; u < a; u++) y.properties[u] = E[u]
  3943. } else y.properties = E.slice(0);
  3944. this.createRow.push(y);
  3945. if (t) {
  3946. t.instances.push(y)
  3947. }
  3948. this.objectcount++;
  3949. if (v.is_contained) {
  3950. y.is_contained = true;
  3951. if (y.recycled) y.siblings.length = 0;
  3952. else y.siblings = []; if (!n && !o) {
  3953. for (u = 0, a = v.container.length; u < a; u++) {
  3954. if (v.container[u] === v) continue;
  3955. if (!v.container[u].default_instance) {
  3956. return null
  3957. }
  3958. y.siblings.push(this.createInstanceFromInit(v.container[u].default_instance, g, false, m ? y.x : r, m ? y.y : s, true))
  3959. }
  3960. for (u = 0, a = y.siblings.length; u < a; u++) {
  3961. y.siblings[u].siblings.push(y);
  3962. for (f = 0; f < a; f++) {
  3963. if (u !== f) y.siblings[u].siblings.push(y.siblings[f])
  3964. }
  3965. }
  3966. }
  3967. } else {
  3968. y.is_contained = false;
  3969. y.siblings = null
  3970. }
  3971. y.onCreate();
  3972. if (!y.recycled) cr.seal(y);
  3973. for (u = 0, a = y.behavior_insts.length; u < a; u++) {
  3974. if (y.behavior_insts[u].postCreate) y.behavior_insts[u].postCreate()
  3975. }
  3976. return y
  3977. };
  3978. e.prototype.getLayerByName = function(e) {
  3979. var t, n;
  3980. for (t = 0, n = this.running_layout.layers.length; t < n; t++) {
  3981. var r = this.running_layout.layers[t];
  3982. if (cr.equals_nocase(r.name, e)) return r
  3983. }
  3984. return null
  3985. };
  3986. e.prototype.getLayerByNumber = function(e) {
  3987. e = cr.floor(e);
  3988. if (e < 0) e = 0;
  3989. if (e >= this.running_layout.layers.length) e = this.running_layout.layers.length - 1;
  3990. return this.running_layout.layers[e]
  3991. };
  3992. e.prototype.getLayer = function(e) {
  3993. if (cr.is_number(e)) return this.getLayerByNumber(e);
  3994. else return this.getLayerByName(e.toString())
  3995. };
  3996. e.prototype.clearSol = function(e) {
  3997. var t, n;
  3998. for (t = 0, n = e.length; t < n; t++) {
  3999. e[t].getCurrentSol().select_all = true
  4000. }
  4001. };
  4002. e.prototype.pushCleanSol = function(e) {
  4003. var t, n;
  4004. for (t = 0, n = e.length; t < n; t++) {
  4005. e[t].pushCleanSol()
  4006. }
  4007. };
  4008. e.prototype.pushCopySol = function(e) {
  4009. var t, n;
  4010. for (t = 0, n = e.length; t < n; t++) {
  4011. e[t].pushCopySol()
  4012. }
  4013. };
  4014. e.prototype.popSol = function(e) {
  4015. var t, n;
  4016. for (t = 0, n = e.length; t < n; t++) {
  4017. e[t].popSol()
  4018. }
  4019. };
  4020. e.prototype.testAndSelectCanvasPointOverlap = function(e, t, n, r) {
  4021. var i = e.getCurrentSol();
  4022. var s, o, u, a;
  4023. var f, l;
  4024. if (i.select_all) {
  4025. if (!r) {
  4026. i.select_all = false;
  4027. i.instances.length = 0
  4028. }
  4029. for (s = 0, a = e.instances.length; s < a; s++) {
  4030. u = e.instances[s];
  4031. u.update_bbox();
  4032. f = u.layer.canvasToLayer(t, n, true);
  4033. l = u.layer.canvasToLayer(t, n, false);
  4034. if (u.contains_pt(f, l)) {
  4035. if (r) return false;
  4036. else i.instances.push(u)
  4037. }
  4038. }
  4039. } else {
  4040. o = 0;
  4041. for (s = 0, a = i.instances.length; s < a; s++) {
  4042. u = i.instances[s];
  4043. u.update_bbox();
  4044. f = u.layer.canvasToLayer(t, n, true);
  4045. l = u.layer.canvasToLayer(t, n, false);
  4046. if (u.contains_pt(f, l)) {
  4047. if (r) return false;
  4048. else {
  4049. i.instances[o] = i.instances[s];
  4050. o++
  4051. }
  4052. }
  4053. }
  4054. if (!r) i.instances.length = o
  4055. }
  4056. e.applySolToContainer();
  4057. if (r) return true;
  4058. else return i.hasObjects()
  4059. };
  4060. e.prototype.testOverlap = function(e, t) {
  4061. if (!e || !t || e === t || !e.collisionsEnabled || !t.collisionsEnabled) return false;
  4062. e.update_bbox();
  4063. t.update_bbox();
  4064. var n = e.layer;
  4065. var r = t.layer;
  4066. var i = n !== r && (n.parallaxX !== r.parallaxX || r.parallaxY !== r.parallaxY || n.scale !== r.scale || n.angle !== r.angle || n.zoomRate !== r.zoomRate);
  4067. var s, o, u, a, f, l, c, h;
  4068. if (!i) {
  4069. if (!e.bbox.intersects_rect(t.bbox)) return false;
  4070. if (!e.bquad.intersects_quad(t.bquad)) return false;
  4071. f = e.collision_poly && !e.collision_poly.is_empty();
  4072. l = t.collision_poly && !t.collision_poly.is_empty();
  4073. if (!f && !l) return true;
  4074. if (f) {
  4075. e.collision_poly.cache_poly(e.width, e.height, e.angle);
  4076. c = e.collision_poly
  4077. } else {
  4078. this.temp_poly.set_from_quad(e.bquad, e.x, e.y, e.width, e.height);
  4079. c = this.temp_poly
  4080. } if (l) {
  4081. t.collision_poly.cache_poly(t.width, t.height, t.angle);
  4082. h = t.collision_poly
  4083. } else {
  4084. this.temp_poly.set_from_quad(t.bquad, t.x, t.y, t.width, t.height);
  4085. h = this.temp_poly
  4086. }
  4087. return c.intersects_poly(h, t.x - e.x, t.y - e.y)
  4088. } else {
  4089. f = e.collision_poly && !e.collision_poly.is_empty();
  4090. l = t.collision_poly && !t.collision_poly.is_empty();
  4091. if (f) {
  4092. e.collision_poly.cache_poly(e.width, e.height, e.angle);
  4093. this.temp_poly.set_from_poly(e.collision_poly)
  4094. } else {
  4095. this.temp_poly.set_from_quad(e.bquad, e.x, e.y, e.width, e.height)
  4096. }
  4097. c = this.temp_poly;
  4098. if (l) {
  4099. t.collision_poly.cache_poly(t.width, t.height, t.angle);
  4100. this.temp_poly2.set_from_poly(t.collision_poly)
  4101. } else {
  4102. this.temp_poly2.set_from_quad(t.bquad, t.x, t.y, t.width, t.height)
  4103. }
  4104. h = this.temp_poly2;
  4105. for (s = 0, o = c.pts_count; s < o; s++) {
  4106. u = c.pts_cache[s * 2];
  4107. a = c.pts_cache[s * 2 + 1];
  4108. c.pts_cache[s * 2] = n.layerToCanvas(u + e.x, a + e.y, true);
  4109. c.pts_cache[s * 2 + 1] = n.layerToCanvas(u + e.x, a + e.y, false)
  4110. }
  4111. for (s = 0, o = h.pts_count; s < o; s++) {
  4112. u = h.pts_cache[s * 2];
  4113. a = h.pts_cache[s * 2 + 1];
  4114. h.pts_cache[s * 2] = r.layerToCanvas(u + t.x, a + t.y, true);
  4115. h.pts_cache[s * 2 + 1] = r.layerToCanvas(u + t.x, a + t.y, false)
  4116. }
  4117. return c.intersects_poly(h, 0, 0)
  4118. }
  4119. };
  4120. var s = new cr.quad;
  4121. var o = new cr.rect(0, 0, 0, 0);
  4122. e.prototype.testRectOverlap = function(e, t) {
  4123. if (!t || !t.collisionsEnabled) return false;
  4124. t.update_bbox();
  4125. var n = t.layer;
  4126. var r, i;
  4127. if (!t.bbox.intersects_rect(e)) return false;
  4128. s.set_from_rect(e);
  4129. if (!t.bquad.intersects_quad(s)) return false;
  4130. r = t.collision_poly && !t.collision_poly.is_empty();
  4131. if (!r) return true;
  4132. t.collision_poly.cache_poly(t.width, t.height, t.angle);
  4133. s.offset(-e.left, -e.top);
  4134. this.temp_poly.set_from_quad(s, 0, 0, 1, 1);
  4135. return t.collision_poly.intersects_poly(this.temp_poly, e.left - t.x, e.top - t.y)
  4136. };
  4137. e.prototype.testSegmentOverlap = function(e, t, n, r, i) {
  4138. if (!i || !i.collisionsEnabled) return false;
  4139. i.update_bbox();
  4140. var s = i.layer;
  4141. var u, a;
  4142. o.set(cr.min(e, n), cr.min(t, r), cr.max(e, n), cr.max(t, r));
  4143. if (!i.bbox.intersects_rect(o)) return false;
  4144. if (!i.bquad.intersects_segment(e, t, n, r)) return false;
  4145. u = i.collision_poly && !i.collision_poly.is_empty();
  4146. if (!u) return true;
  4147. i.collision_poly.cache_poly(i.width, i.height, i.angle);
  4148. return i.collision_poly.intersects_segment(i.x, i.y, e, t, n, r)
  4149. };
  4150. e.prototype.typeHasBehavior = function(e, t) {
  4151. if (!t) return false;
  4152. var n, r, i, s, o;
  4153. for (n = 0, r = e.behaviors.length; n < r; n++) {
  4154. if (e.behaviors[n].behavior instanceof t) return true
  4155. }
  4156. if (!e.is_family) {
  4157. for (n = 0, r = e.families.length; n < r; n++) {
  4158. o = e.families[n];
  4159. for (i = 0, s = o.behaviors.length; i < s; i++) {
  4160. if (o.behaviors[i].behavior instanceof t) return true
  4161. }
  4162. }
  4163. }
  4164. return false
  4165. };
  4166. e.prototype.typeHasNoSaveBehavior = function(e) {
  4167. return this.typeHasBehavior(e, cr.behaviors.NoSave)
  4168. };
  4169. e.prototype.typeHasPersistBehavior = function(e) {
  4170. return this.typeHasBehavior(e, cr.behaviors.Persist)
  4171. };
  4172. e.prototype.getSolidBehavior = function() {
  4173. if (!cr.behaviors.solid) return null;
  4174. var e, t;
  4175. for (e = 0, t = this.behaviors.length; e < t; e++) {
  4176. if (this.behaviors[e] instanceof cr.behaviors.solid) return this.behaviors[e]
  4177. }
  4178. return null
  4179. };
  4180. e.prototype.testOverlapSolid = function(e) {
  4181. var t = this.getSolidBehavior();
  4182. if (!t) return null;
  4183. var n, r, i;
  4184. var s = t.my_instances.valuesRef();
  4185. for (n = 0, r = s.length; n < r; ++n) {
  4186. i = s[n];
  4187. if (!i.extra.solidEnabled) continue;
  4188. if (this.testOverlap(e, i)) return i
  4189. }
  4190. return null
  4191. };
  4192. e.prototype.testRectOverlapSolid = function(e) {
  4193. var t = this.getSolidBehavior();
  4194. if (!t) return null;
  4195. var n, r, i;
  4196. var s = t.my_instances.valuesRef();
  4197. for (n = 0, r = s.length; n < r; ++n) {
  4198. i = s[n];
  4199. if (!i.extra.solidEnabled) continue;
  4200. if (this.testRectOverlap(e, i)) return i
  4201. }
  4202. return null
  4203. };
  4204. var u = [];
  4205. e.prototype.testOverlapJumpThru = function(e, t) {
  4206. var n = null;
  4207. var r, i, s;
  4208. if (!cr.behaviors.jumpthru) return null;
  4209. for (r = 0, i = this.behaviors.length; r < i; r++) {
  4210. if (this.behaviors[r] instanceof cr.behaviors.jumpthru) {
  4211. n = this.behaviors[r];
  4212. break
  4213. }
  4214. }
  4215. if (!n) return null;
  4216. var o = null;
  4217. if (t) {
  4218. o = u;
  4219. o.length = 0
  4220. }
  4221. var a = n.my_instances.valuesRef();
  4222. for (r = 0, i = a.length; r < i; ++r) {
  4223. s = a[r];
  4224. if (!s.extra.jumpthruEnabled) continue;
  4225. if (this.testOverlap(e, s)) {
  4226. if (t) o.push(s);
  4227. else return s
  4228. }
  4229. }
  4230. return o
  4231. };
  4232. e.prototype.pushOutSolid = function(e, t, n, r, i, s) {
  4233. var o = r || 50;
  4234. var u = e.x;
  4235. var a = e.y;
  4236. var f;
  4237. var l = null,
  4238. c = null;
  4239. for (f = 0; f < o; f++) {
  4240. e.x = u + t * f;
  4241. e.y = a + n * f;
  4242. e.set_bbox_changed();
  4243. if (!this.testOverlap(e, l)) {
  4244. l = this.testOverlapSolid(e);
  4245. if (l) c = l;
  4246. if (!l) {
  4247. if (i) {
  4248. if (s) l = this.testOverlap(e, s) ? s : null;
  4249. else l = this.testOverlapJumpThru(e); if (l) c = l
  4250. }
  4251. if (!l) {
  4252. if (c) this.pushInFractional(e, t, n, c, 16);
  4253. return true
  4254. }
  4255. }
  4256. }
  4257. }
  4258. e.x = u;
  4259. e.y = a;
  4260. e.set_bbox_changed();
  4261. return false
  4262. };
  4263. e.prototype.pushOut = function(e, t, n, r, i) {
  4264. var s = r || 50;
  4265. var o = e.x;
  4266. var u = e.y;
  4267. var a;
  4268. for (a = 0; a < s; a++) {
  4269. e.x = o + t * a;
  4270. e.y = u + n * a;
  4271. e.set_bbox_changed();
  4272. if (!this.testOverlap(e, i)) return true
  4273. }
  4274. e.x = o;
  4275. e.y = u;
  4276. e.set_bbox_changed();
  4277. return false
  4278. };
  4279. e.prototype.pushInFractional = function(e, t, n, r, i) {
  4280. var s = 2;
  4281. var o;
  4282. var u = false;
  4283. var a = false;
  4284. var f = e.x;
  4285. var l = e.y;
  4286. while (s <= i) {
  4287. o = 1 / s;
  4288. s *= 2;
  4289. e.x += t * o * (u ? 1 : -1);
  4290. e.y += n * o * (u ? 1 : -1);
  4291. e.set_bbox_changed();
  4292. if (this.testOverlap(e, r)) {
  4293. u = true;
  4294. a = true
  4295. } else {
  4296. u = false;
  4297. a = false;
  4298. f = e.x;
  4299. l = e.y
  4300. }
  4301. }
  4302. if (a) {
  4303. e.x = f;
  4304. e.y = l;
  4305. e.set_bbox_changed()
  4306. }
  4307. };
  4308. e.prototype.pushOutSolidNearest = function(e, t) {
  4309. var n = cr.is_undefined(t) ? 100 : t;
  4310. var r = 0;
  4311. var i = e.x;
  4312. var s = e.y;
  4313. var o = 0;
  4314. var u = 0,
  4315. a = 0;
  4316. var f = this.testOverlapSolid(e);
  4317. if (!f) return true;
  4318. while (r <= n) {
  4319. switch (o) {
  4320. case 0:
  4321. u = 0;
  4322. a = -1;
  4323. r++;
  4324. break;
  4325. case 1:
  4326. u = 1;
  4327. a = -1;
  4328. break;
  4329. case 2:
  4330. u = 1;
  4331. a = 0;
  4332. break;
  4333. case 3:
  4334. u = 1;
  4335. a = 1;
  4336. break;
  4337. case 4:
  4338. u = 0;
  4339. a = 1;
  4340. break;
  4341. case 5:
  4342. u = -1;
  4343. a = 1;
  4344. break;
  4345. case 6:
  4346. u = -1;
  4347. a = 0;
  4348. break;
  4349. case 7:
  4350. u = -1;
  4351. a = -1;
  4352. break
  4353. }
  4354. o = (o + 1) % 8;
  4355. e.x = cr.floor(i + u * r);
  4356. e.y = cr.floor(s + a * r);
  4357. e.set_bbox_changed();
  4358. if (!this.testOverlap(e, f)) {
  4359. f = this.testOverlapSolid(e);
  4360. if (!f) return true
  4361. }
  4362. }
  4363. e.x = i;
  4364. e.y = s;
  4365. e.set_bbox_changed();
  4366. return false
  4367. };
  4368. e.prototype.registerCollision = function(e, t) {
  4369. if (!e.collisionsEnabled || !t.collisionsEnabled) return;
  4370. this.registered_collisions.push([e, t])
  4371. };
  4372. e.prototype.checkRegisteredCollision = function(e, t) {
  4373. var n, r, i;
  4374. for (n = 0, r = this.registered_collisions.length; n < r; n++) {
  4375. i = this.registered_collisions[n];
  4376. if (i[0] == e && i[1] == t || i[0] == t && i[1] == e) return true
  4377. }
  4378. return false
  4379. };
  4380. e.prototype.calculateSolidBounceAngle = function(e, t, n, r) {
  4381. var i = e.x;
  4382. var s = e.y;
  4383. var o = cr.max(10, cr.distanceTo(t, n, i, s));
  4384. var u = cr.angleTo(t, n, i, s);
  4385. var a = r || this.testOverlapSolid(e);
  4386. if (!a) return cr.clamp_angle(u + cr.PI);
  4387. var f = a;
  4388. var l, c, h, p;
  4389. var d = cr.to_radians(5);
  4390. for (l = 1; l < 36; l++) {
  4391. c = u - l * d;
  4392. e.x = t + Math.cos(c) * o;
  4393. e.y = n + Math.sin(c) * o;
  4394. e.set_bbox_changed();
  4395. if (!this.testOverlap(e, f)) {
  4396. f = r ? null : this.testOverlapSolid(e);
  4397. if (!f) {
  4398. h = c;
  4399. break
  4400. }
  4401. }
  4402. }
  4403. if (l === 36) h = cr.clamp_angle(u + cr.PI);
  4404. var f = a;
  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. p = c;
  4414. break
  4415. }
  4416. }
  4417. }
  4418. if (l === 36) p = cr.clamp_angle(u + cr.PI);
  4419. e.x = i;
  4420. e.y = s;
  4421. e.set_bbox_changed();
  4422. if (p === h) return p;
  4423. var v = cr.angleDiff(p, h) / 2;
  4424. var m;
  4425. if (cr.angleClockwise(p, h)) {
  4426. m = cr.clamp_angle(h + v + cr.PI)
  4427. } else {
  4428. m = cr.clamp_angle(p + v)
  4429. }
  4430. var g = Math.cos(u);
  4431. var y = Math.sin(u);
  4432. var b = Math.cos(m);
  4433. var w = Math.sin(m);
  4434. var E = g * b + y * w;
  4435. var S = g - 2 * E * b;
  4436. var x = y - 2 * E * w;
  4437. return cr.angleTo(0, 0, S, x)
  4438. };
  4439. var a = [];
  4440. var f = -1;
  4441. e.prototype.trigger = function(e, t, n) {
  4442. if (!this.running_layout) return false;
  4443. var r = this.running_layout.event_sheet;
  4444. if (!r) return false;
  4445. f++;
  4446. if (f === a.length) a.push(new cr.ObjectSet);
  4447. else a[f].clear();
  4448. var i = this.triggerOnSheet(e, t, r, n);
  4449. f--;
  4450. return i
  4451. };
  4452. e.prototype.triggerOnSheet = function(e, t, n, r) {
  4453. var i = a[f];
  4454. if (i.contains(n)) return false;
  4455. i.add(n);
  4456. var s = n.includes.valuesRef();
  4457. var o = false;
  4458. var u, l, c;
  4459. for (u = 0, l = s.length; u < l; u++) {
  4460. if (s[u].isActive()) {
  4461. c = this.triggerOnSheet(e, t, s[u].include_sheet, r);
  4462. o = o || c
  4463. }
  4464. }
  4465. if (!t) {
  4466. c = this.triggerOnSheetForTypeName(e, t, "system", n, r);
  4467. o = o || c
  4468. } else {
  4469. c = this.triggerOnSheetForTypeName(e, t, t.type.name, n, r);
  4470. o = o || c;
  4471. for (u = 0, l = t.type.families.length; u < l; u++) {
  4472. c = this.triggerOnSheetForTypeName(e, t, t.type.families[u].name, n, r);
  4473. o = o || c
  4474. }
  4475. }
  4476. return o
  4477. };
  4478. e.prototype.triggerOnSheetForTypeName = function(e, t, n, r, i) {
  4479. var s, o;
  4480. var u = false,
  4481. a = false;
  4482. var f, l;
  4483. var c = typeof i !== "undefined";
  4484. var h = c ? r.fasttriggers : r.triggers;
  4485. var p = h[n];
  4486. if (!p) return u;
  4487. var d = null;
  4488. for (s = 0, o = p.length; s < o; s++) {
  4489. if (p[s].method == e) {
  4490. d = p[s].evs;
  4491. break
  4492. }
  4493. }
  4494. if (!d) return u;
  4495. var v;
  4496. if (c) {
  4497. v = d[i]
  4498. } else {
  4499. v = d
  4500. } if (!v) return null;
  4501. for (s = 0, o = v.length; s < o; s++) {
  4502. f = v[s][0];
  4503. l = v[s][1];
  4504. a = this.executeSingleTrigger(t, n, f, l);
  4505. u = u || a
  4506. }
  4507. return u
  4508. };
  4509. e.prototype.executeSingleTrigger = function(e, t, n, r) {
  4510. var i, s;
  4511. var o = false;
  4512. this.trigger_depth++;
  4513. var u = this.getCurrentEventStack().current_event;
  4514. if (u) this.pushCleanSol(u.solModifiersIncludingParents);
  4515. var a = this.trigger_depth > 1;
  4516. this.pushCleanSol(n.solModifiersIncludingParents);
  4517. if (a) this.pushLocalVarStack();
  4518. var l = this.pushEventStack(n);
  4519. l.current_event = n;
  4520. if (e) {
  4521. var c = this.types[t].getCurrentSol();
  4522. c.select_all = false;
  4523. c.instances.length = 1;
  4524. c.instances[0] = e;
  4525. this.types[t].applySolToContainer()
  4526. }
  4527. var h = true;
  4528. if (n.parent) {
  4529. var p = l.temp_parents_arr;
  4530. var d = n.parent;
  4531. while (d) {
  4532. p.push(d);
  4533. d = d.parent
  4534. }
  4535. p.reverse();
  4536. for (i = 0, s = p.length; i < s; i++) {
  4537. if (!p[i].run_pretrigger()) {
  4538. h = false;
  4539. break
  4540. }
  4541. }
  4542. }
  4543. if (h) {
  4544. this.execcount++;
  4545. if (n.orblock) n.run_orblocktrigger(r);
  4546. else n.run();
  4547. o = o || l.last_event_true
  4548. }
  4549. this.popEventStack();
  4550. if (a) this.popLocalVarStack();
  4551. this.popSol(n.solModifiersIncludingParents);
  4552. if (u) this.popSol(u.solModifiersIncludingParents);
  4553. if (this.isInOnDestroy === 0 && f === 0 && !this.isRunningEvents && (!this.deathRow.isEmpty() || this.createRow.length)) {
  4554. this.ClearDeathRow()
  4555. }
  4556. this.trigger_depth--;
  4557. return o
  4558. };
  4559. e.prototype.getCurrentCondition = function() {
  4560. var e = this.getCurrentEventStack();
  4561. return e.current_event.conditions[e.cndindex]
  4562. };
  4563. e.prototype.getCurrentAction = function() {
  4564. var e = this.getCurrentEventStack();
  4565. return e.current_event.actions[e.actindex]
  4566. };
  4567. e.prototype.pushLocalVarStack = function() {
  4568. this.localvar_stack_index++;
  4569. if (this.localvar_stack_index >= this.localvar_stack.length) this.localvar_stack.push([])
  4570. };
  4571. e.prototype.popLocalVarStack = function() {
  4572. this.localvar_stack_index--
  4573. };
  4574. e.prototype.getCurrentLocalVarStack = function() {
  4575. return this.localvar_stack[this.localvar_stack_index]
  4576. };
  4577. e.prototype.pushEventStack = function(e) {
  4578. this.event_stack_index++;
  4579. if (this.event_stack_index >= this.event_stack.length) this.event_stack.push(new cr.eventStackFrame);
  4580. var t = this.getCurrentEventStack();
  4581. t.reset(e);
  4582. return t
  4583. };
  4584. e.prototype.popEventStack = function() {
  4585. this.event_stack_index--
  4586. };
  4587. e.prototype.getCurrentEventStack = function() {
  4588. return this.event_stack[this.event_stack_index]
  4589. };
  4590. e.prototype.pushLoopStack = function(e) {
  4591. this.loop_stack_index++;
  4592. if (this.loop_stack_index >= this.loop_stack.length) {
  4593. this.loop_stack.push(cr.seal({
  4594. name: e,
  4595. index: 0,
  4596. stopped: false
  4597. }))
  4598. }
  4599. var t = this.getCurrentLoop();
  4600. t.name = e;
  4601. t.index = 0;
  4602. t.stopped = false;
  4603. return t
  4604. };
  4605. e.prototype.popLoopStack = function() {
  4606. this.loop_stack_index--
  4607. };
  4608. e.prototype.getCurrentLoop = function() {
  4609. return this.loop_stack[this.loop_stack_index]
  4610. };
  4611. e.prototype.getEventVariableByName = function(e, t) {
  4612. var n, r, i, s, o, u;
  4613. while (t) {
  4614. for (n = 0, r = t.subevents.length; n < r; n++) {
  4615. u = t.subevents[n];
  4616. if (u instanceof cr.eventvariable && cr.equals_nocase(e, u.name)) return u
  4617. }
  4618. t = t.parent
  4619. }
  4620. for (n = 0, r = this.eventsheets_by_index.length; n < r; n++) {
  4621. o = this.eventsheets_by_index[n];
  4622. for (i = 0, s = o.events.length; i < s; i++) {
  4623. u = o.events[i];
  4624. if (u instanceof cr.eventvariable && cr.equals_nocase(e, u.name)) return u
  4625. }
  4626. }
  4627. return null
  4628. };
  4629. e.prototype.getLayoutBySid = function(e) {
  4630. var t, n;
  4631. for (t = 0, n = this.layouts_by_index.length; t < n; t++) {
  4632. if (this.layouts_by_index[t].sid === e) return this.layouts_by_index[t]
  4633. }
  4634. return null
  4635. };
  4636. e.prototype.getObjectTypeBySid = function(e) {
  4637. var t, n;
  4638. for (t = 0, n = this.types_by_index.length; t < n; t++) {
  4639. if (this.types_by_index[t].sid === e) return this.types_by_index[t]
  4640. }
  4641. return null
  4642. };
  4643. e.prototype.getGroupBySid = function(e) {
  4644. var t, n;
  4645. for (t = 0, n = this.allGroups.length; t < n; t++) {
  4646. if (this.allGroups[t].sid === e) return this.allGroups[t]
  4647. }
  4648. return null
  4649. };
  4650. e.prototype.signalContinuousPreview = function() {
  4651. this.signalledContinuousPreview = true
  4652. };
  4653. e.prototype.handleSaveLoad = function() {
  4654. var e = this;
  4655. var t = this.saveToSlot;
  4656. var n = this.lastSaveJson;
  4657. var r = this.loadFromSlot;
  4658. var i = false;
  4659. if (this.signalledContinuousPreview) {
  4660. i = true;
  4661. t = "__c2_continuouspreview";
  4662. this.signalledContinuousPreview = false
  4663. }
  4664. if (t.length) {
  4665. this.ClearDeathRow();
  4666. n = this.saveToJSONString();
  4667. if (window.indexedDB && !this.isCocoonJs) {
  4668. c(t, n, function() {
  4669. cr.logexport("Saved state to IndexedDB storage (" + n.length + " bytes)");
  4670. e.lastSaveJson = n;
  4671. e.trigger(cr.system_object.prototype.cnds.OnSaveComplete, null);
  4672. e.lastSaveJson = "";
  4673. if (i) p()
  4674. }, function(r) {
  4675. try {
  4676. localStorage["__c2save_" + t] = n;
  4677. cr.logexport("Saved state to WebStorage (" + n.length + " bytes)");
  4678. e.lastSaveJson = n;
  4679. e.trigger(cr.system_object.prototype.cnds.OnSaveComplete, null);
  4680. e.lastSaveJson = "";
  4681. if (i) p()
  4682. } catch (s) {
  4683. cr.logexport("Failed to save game state: " + r + "; " + s)
  4684. }
  4685. })
  4686. } else {
  4687. try {
  4688. localStorage["__c2save_" + t] = n;
  4689. cr.logexport("Saved state to WebStorage (" + n.length + " bytes)");
  4690. e.lastSaveJson = n;
  4691. this.trigger(cr.system_object.prototype.cnds.OnSaveComplete, null);
  4692. e.lastSaveJson = "";
  4693. if (i) p()
  4694. } catch (s) {
  4695. cr.logexport("Error saving to WebStorage: " + s)
  4696. }
  4697. }
  4698. this.saveToSlot = "";
  4699. this.loadFromSlot = "";
  4700. this.loadFromJson = ""
  4701. }
  4702. if (r.length) {
  4703. if (window.indexedDB && !this.isCocoonJs) {
  4704. h(r, function(t) {
  4705. if (t) {
  4706. e.loadFromJson = t;
  4707. cr.logexport("Loaded state from IndexedDB storage (" + e.loadFromJson.length + " bytes)")
  4708. } else {
  4709. e.loadFromJson = localStorage["__c2save_" + r] || "";
  4710. cr.logexport("Loaded state from WebStorage (" + e.loadFromJson.length + " bytes)")
  4711. }
  4712. e.suspendDrawing = false;
  4713. if (!e.loadFromJson.length) e.trigger(cr.system_object.prototype.cnds.OnLoadFailed, null)
  4714. }, function(t) {
  4715. e.loadFromJson = localStorage["__c2save_" + r] || "";
  4716. cr.logexport("Loaded state from WebStorage (" + e.loadFromJson.length + " bytes)");
  4717. e.suspendDrawing = false;
  4718. if (!e.loadFromJson.length) e.trigger(cr.system_object.prototype.cnds.OnLoadFailed, null)
  4719. })
  4720. } else {
  4721. this.loadFromJson = localStorage["__c2save_" + r] || "";
  4722. cr.logexport("Loaded state from WebStorage (" + this.loadFromJson.length + " bytes)");
  4723. this.suspendDrawing = false;
  4724. if (!e.loadFromJson.length) e.trigger(cr.system_object.prototype.cnds.OnLoadFailed, null)
  4725. }
  4726. this.loadFromSlot = "";
  4727. this.saveToSlot = ""
  4728. }
  4729. if (this.loadFromJson.length) {
  4730. this.ClearDeathRow();
  4731. this.loadFromJSONString(this.loadFromJson);
  4732. this.lastSaveJson = this.loadFromJson;
  4733. this.trigger(cr.system_object.prototype.cnds.OnLoadComplete, null);
  4734. this.lastSaveJson = "";
  4735. this.loadFromJson = ""
  4736. }
  4737. };
  4738. e.prototype.saveToJSONString = function() {
  4739. var e, t, n, r, i, s, o, u, a, f, l, c;
  4740. var h = {
  4741. c2save: true,
  4742. version: 1,
  4743. rt: {
  4744. time: this.kahanTime.sum,
  4745. timescale: this.timescale,
  4746. tickcount: this.tickcount,
  4747. execcount: this.execcount,
  4748. next_uid: this.next_uid,
  4749. running_layout: this.running_layout.sid,
  4750. start_time_offset: Date.now() - this.start_time
  4751. },
  4752. types: {},
  4753. layouts: {},
  4754. events: {
  4755. groups: {},
  4756. cnds: {},
  4757. acts: {},
  4758. vars: {}
  4759. }
  4760. };
  4761. for (e = 0, t = this.types_by_index.length; e < t; e++) {
  4762. i = this.types_by_index[e];
  4763. if (i.is_family || this.typeHasNoSaveBehavior(i)) continue;
  4764. o = {
  4765. instances: []
  4766. };
  4767. if (cr.hasAnyOwnProperty(i.extra)) o["ex"] = d(i.extra);
  4768. for (n = 0, r = i.instances.length; n < r; n++) {
  4769. o["instances"].push(this.saveInstanceToJSON(i.instances[n]))
  4770. }
  4771. h["types"][i.sid.toString()] = o
  4772. }
  4773. for (e = 0, t = this.layouts_by_index.length; e < t; e++) {
  4774. s = this.layouts_by_index[e];
  4775. h["layouts"][s.sid.toString()] = s.saveToJSON()
  4776. }
  4777. var p = h["events"]["groups"];
  4778. for (e = 0, t = this.allGroups.length; e < t; e++) {
  4779. u = this.allGroups[e];
  4780. p[u.sid.toString()] = !!this.activeGroups[u.group_name]
  4781. }
  4782. var v = h["events"]["cnds"];
  4783. for (c in this.cndsBySid) {
  4784. if (this.cndsBySid.hasOwnProperty(c)) {
  4785. a = this.cndsBySid[c];
  4786. if (cr.hasAnyOwnProperty(a.extra)) v[c] = {
  4787. ex: d(a.extra)
  4788. }
  4789. }
  4790. }
  4791. var m = h["events"]["acts"];
  4792. for (c in this.actsBySid) {
  4793. if (this.actsBySid.hasOwnProperty(c)) {
  4794. f = this.actsBySid[c];
  4795. if (cr.hasAnyOwnProperty(f.extra)) m[c] = {
  4796. ex: f.extra
  4797. }
  4798. }
  4799. }
  4800. var g = h["events"]["vars"];
  4801. for (c in this.varsBySid) {
  4802. if (this.varsBySid.hasOwnProperty(c)) {
  4803. l = this.varsBySid[c];
  4804. if (!l.is_constant && (!l.parent || l.is_static)) g[c] = l.data
  4805. }
  4806. }
  4807. h["system"] = this.system.saveToJSON();
  4808. return JSON.stringify(h)
  4809. };
  4810. e.prototype.refreshUidMap = function() {
  4811. var e, t, n, r, i, s;
  4812. this.objectsByUid = {};
  4813. for (e = 0, t = this.types_by_index.length; e < t; e++) {
  4814. n = this.types_by_index[e];
  4815. if (n.is_family) continue;
  4816. for (r = 0, i = n.instances.length; r < i; r++) {
  4817. s = n.instances[r];
  4818. this.objectsByUid[s.uid.toString()] = s
  4819. }
  4820. }
  4821. };
  4822. e.prototype.loadFromJSONString = function(e) {
  4823. var t = JSON.parse(e);
  4824. if (!t["c2save"]) return;
  4825. if (t["version"] > 1) return;
  4826. var n = t["rt"];
  4827. this.kahanTime.reset();
  4828. this.kahanTime.sum = n["time"];
  4829. this.timescale = n["timescale"];
  4830. this.tickcount = n["tickcount"];
  4831. this.execcount = n["execcount"];
  4832. this.start_time = Date.now() - n["start_time_offset"];
  4833. var r = n["running_layout"];
  4834. if (r !== this.running_layout.sid) {
  4835. var i = this.getLayoutBySid(r);
  4836. if (i) this.doChangeLayout(i);
  4837. else return
  4838. }
  4839. this.isLoadingState = true;
  4840. var s, o, u, a, f, l, c, h, p, d, v, m, g, y, b, w, E;
  4841. var S = t["types"];
  4842. for (c in S) {
  4843. if (S.hasOwnProperty(c)) {
  4844. h = this.getObjectTypeBySid(parseInt(c, 10));
  4845. if (!h || h.is_family || this.typeHasNoSaveBehavior(h)) continue;
  4846. if (S[c]["ex"]) h.extra = S[c]["ex"];
  4847. else cr.wipe(h.extra);
  4848. p = h.instances;
  4849. d = S[c]["instances"];
  4850. for (s = 0, o = cr.min(p.length, d.length); s < o; s++) {
  4851. this.loadInstanceFromJSON(p[s], d[s])
  4852. }
  4853. for (s = d.length, o = p.length; s < o; s++) this.DestroyInstance(p[s]);
  4854. for (s = p.length, o = d.length; s < o; s++) {
  4855. y = null;
  4856. if (h.plugin.is_world) {
  4857. y = this.running_layout.getLayerBySid(d[s]["w"]["l"]);
  4858. if (!y) continue
  4859. }
  4860. v = this.createInstanceFromInit(h.default_instance, y, false, 0, 0, true);
  4861. this.loadInstanceFromJSON(v, d[s])
  4862. }
  4863. h.stale_iids = true
  4864. }
  4865. }
  4866. this.ClearDeathRow();
  4867. this.refreshUidMap();
  4868. var x = t["layouts"];
  4869. for (c in x) {
  4870. if (x.hasOwnProperty(c)) {
  4871. g = this.getLayoutBySid(parseInt(c, 10));
  4872. if (!g) continue;
  4873. g.loadFromJSON(x[c])
  4874. }
  4875. }
  4876. var T = t["events"]["groups"];
  4877. for (c in T) {
  4878. if (T.hasOwnProperty(c)) {
  4879. b = this.getGroupBySid(parseInt(c, 10));
  4880. if (b) this.activeGroups[b.group_name] = T[c]
  4881. }
  4882. }
  4883. var N = t["events"]["cnds"];
  4884. for (c in N) {
  4885. if (N.hasOwnProperty(c) && this.cndsBySid.hasOwnProperty(c)) {
  4886. this.cndsBySid[c].extra = N[c]["ex"]
  4887. }
  4888. }
  4889. var C = t["events"]["acts"];
  4890. for (c in C) {
  4891. if (C.hasOwnProperty(c) && this.actsBySid.hasOwnProperty(c)) {
  4892. this.actsBySid[c].extra = C[c]["ex"]
  4893. }
  4894. }
  4895. var k = t["events"]["vars"];
  4896. for (c in k) {
  4897. if (k.hasOwnProperty(c) && this.varsBySid.hasOwnProperty(c)) {
  4898. this.varsBySid[c].data = k[c]
  4899. }
  4900. }
  4901. this.next_uid = n["next_uid"];
  4902. this.isLoadingState = false;
  4903. this.system.loadFromJSON(t["system"]);
  4904. for (s = 0, o = this.types_by_index.length; s < o; s++) {
  4905. h = this.types_by_index[s];
  4906. if (h.is_family) continue;
  4907. for (u = 0, a = h.instances.length; u < a; u++) {
  4908. v = h.instances[u];
  4909. if (h.is_contained) {
  4910. w = v.get_iid();
  4911. v.siblings.length = 0;
  4912. for (f = 0, l = h.container.length; f < l; f++) {
  4913. E = h.container[f];
  4914. if (h === E) continue;
  4915. v.siblings.push(E.instances[w])
  4916. }
  4917. }
  4918. if (v.afterLoad) v.afterLoad();
  4919. if (v.behavior_insts) {
  4920. for (f = 0, l = v.behavior_insts.length; f < l; f++) {
  4921. m = v.behavior_insts[f];
  4922. if (m.afterLoad) m.afterLoad()
  4923. }
  4924. }
  4925. }
  4926. }
  4927. this.redraw = true
  4928. };
  4929. e.prototype.saveInstanceToJSON = function(e) {
  4930. var t, n, r, i, s;
  4931. var o = e.type;
  4932. var u = o.plugin;
  4933. var a = {
  4934. uid: e.uid
  4935. };
  4936. if (cr.hasAnyOwnProperty(e.extra)) a["ex"] = d(e.extra);
  4937. if (e.instance_vars && e.instance_vars.length) {
  4938. a["ivs"] = {};
  4939. for (t = 0, n = e.instance_vars.length; t < n; t++) {
  4940. a["ivs"][e.type.instvar_sids[t].toString()] = e.instance_vars[t]
  4941. }
  4942. }
  4943. if (u.is_world) {
  4944. r = {
  4945. x: e.x,
  4946. y: e.y,
  4947. w: e.width,
  4948. h: e.height,
  4949. l: e.layer.sid,
  4950. zi: e.get_zindex()
  4951. };
  4952. if (e.angle !== 0) r["a"] = e.angle;
  4953. if (e.opacity !== 1) r["o"] = e.opacity;
  4954. if (e.hotspotX !== .5) r["hX"] = e.hotspotX;
  4955. if (e.hotspotY !== .5) r["hY"] = e.hotspotY;
  4956. if (e.blend_mode !== 0) r["bm"] = e.blend_mode;
  4957. if (!e.visible) r["v"] = e.visible;
  4958. if (!e.collisionsEnabled) r["ce"] = e.collisionsEnabled;
  4959. if (e.my_timescale !== -1) r["mts"] = e.my_timescale;
  4960. if (o.effect_types.length) {
  4961. r["fx"] = [];
  4962. for (t = 0, n = o.effect_types.length; t < n; t++) {
  4963. s = o.effect_types[t];
  4964. r["fx"].push({
  4965. name: s.name,
  4966. active: e.active_effect_flags[s.index],
  4967. params: e.effect_params[s.index]
  4968. })
  4969. }
  4970. }
  4971. a["w"] = r
  4972. }
  4973. if (e.behavior_insts && e.behavior_insts.length) {
  4974. a["behs"] = {};
  4975. for (t = 0, n = e.behavior_insts.length; t < n; t++) {
  4976. i = e.behavior_insts[t];
  4977. if (i.saveToJSON) a["behs"][i.type.sid.toString()] = i.saveToJSON()
  4978. }
  4979. }
  4980. if (e.saveToJSON) a["data"] = e.saveToJSON();
  4981. return a
  4982. };
  4983. e.prototype.getInstanceVarIndexBySid = function(e, t) {
  4984. var n, r;
  4985. for (n = 0, r = e.instvar_sids.length; n < r; n++) {
  4986. if (e.instvar_sids[n] === t) return n
  4987. }
  4988. return -1
  4989. };
  4990. e.prototype.getBehaviorIndexBySid = function(e, t) {
  4991. var n, r;
  4992. for (n = 0, r = e.behavior_insts.length; n < r; n++) {
  4993. if (e.behavior_insts[n].type.sid === t) return n
  4994. }
  4995. return -1
  4996. };
  4997. e.prototype.loadInstanceFromJSON = function(e, t) {
  4998. var n, r, i, s, o, u, a, f, l;
  4999. var c;
  5000. var h = e.type;
  5001. var p = h.plugin;
  5002. e.uid = t["uid"];
  5003. if (t["ex"]) e.extra = t["ex"];
  5004. else cr.wipe(e.extra);
  5005. o = t["ivs"];
  5006. if (o) {
  5007. for (n in o) {
  5008. if (o.hasOwnProperty(n)) {
  5009. s = this.getInstanceVarIndexBySid(h, parseInt(n, 10));
  5010. if (s < 0 || s >= e.instance_vars.length) continue;
  5011. e.instance_vars[s] = o[n]
  5012. }
  5013. }
  5014. }
  5015. if (p.is_world) {
  5016. u = t["w"];
  5017. if (e.layer.sid !== u["l"]) {
  5018. c = e.layer;
  5019. e.layer = this.running_layout.getLayerBySid(u["l"]);
  5020. if (e.layer) {
  5021. e.layer.instances.push(e);
  5022. e.layer.zindices_stale = true;
  5023. cr.arrayFindRemove(c.instances, e);
  5024. c.zindices_stale = true
  5025. } else {
  5026. e.layer = c;
  5027. this.DestroyInstance(e)
  5028. }
  5029. }
  5030. e.x = u["x"];
  5031. e.y = u["y"];
  5032. e.width = u["w"];
  5033. e.height = u["h"];
  5034. e.zindex = u["zi"];
  5035. e.angle = u.hasOwnProperty("a") ? u["a"] : 0;
  5036. e.opacity = u.hasOwnProperty("o") ? u["o"] : 1;
  5037. e.hotspotX = u.hasOwnProperty("hX") ? u["hX"] : .5;
  5038. e.hotspotY = u.hasOwnProperty("hY") ? u["hY"] : .5;
  5039. e.visible = u.hasOwnProperty("v") ? u["v"] : true;
  5040. e.collisionsEnabled = u.hasOwnProperty("ce") ? u["ce"] : true;
  5041. e.my_timescale = u.hasOwnProperty("mts") ? u["mts"] : -1;
  5042. e.blend_mode = u.hasOwnProperty("bm") ? u["bm"] : 0;
  5043. e.compositeOp = cr.effectToCompositeOp(e.blend_mode);
  5044. if (this.gl) cr.setGLBlend(e, e.blend_mode, this.gl);
  5045. e.set_bbox_changed();
  5046. if (u.hasOwnProperty("fx")) {
  5047. for (r = 0, i = u["fx"].length; r < i; r++) {
  5048. a = h.getEffectIndexByName(u["fx"][r]["name"]);
  5049. if (a < 0) continue;
  5050. e.active_effect_flags[a] = u["fx"][r]["active"];
  5051. e.effect_params[a] = u["fx"][r]["params"]
  5052. }
  5053. }
  5054. e.updateActiveEffects()
  5055. }
  5056. f = t["behs"];
  5057. if (f) {
  5058. for (n in f) {
  5059. if (f.hasOwnProperty(n)) {
  5060. l = this.getBehaviorIndexBySid(e, parseInt(n, 10));
  5061. if (l < 0) continue;
  5062. e.behavior_insts[l].loadFromJSON(f[n])
  5063. }
  5064. }
  5065. }
  5066. if (t["data"]) e.loadFromJSON(t["data"])
  5067. };
  5068. cr.runtime = e;
  5069. cr.createRuntime = function(t) {
  5070. return new e(document.getElementById(t))
  5071. };
  5072. cr.createDCRuntime = function(t, n) {
  5073. return new e({
  5074. dc: true,
  5075. width: t,
  5076. height: n
  5077. })
  5078. };
  5079. window["cr_createRuntime"] = cr.createRuntime;
  5080. window["cr_createDCRuntime"] = cr.createDCRuntime;
  5081. window["createCocoonJSRuntime"] = function() {
  5082. window["c2cocoonjs"] = true;
  5083. var t = document.createElement("screencanvas") || document.createElement("canvas");
  5084. document.body.appendChild(t);
  5085. var n = new e(t);
  5086. window["c2runtime"] = n;
  5087. window.addEventListener("orientationchange", function() {
  5088. window["c2runtime"]["setSize"](window.innerWidth, window.innerHeight)
  5089. });
  5090. window["c2runtime"]["setSize"](window.innerWidth, window.innerHeight);
  5091. return n
  5092. }
  5093. })();
  5094. window["cr_getC2Runtime"] = function() {
  5095. var e = document.getElementById("c2canvas");
  5096. if (e) return e["c2runtime"];
  5097. else if (window["c2runtime"]) return window["c2runtime"];
  5098. else return null
  5099. };
  5100. window["cr_sizeCanvas"] = function(e, t) {
  5101. if (e === 0 || t === 0) return;
  5102. var n = window["cr_getC2Runtime"]();
  5103. if (n) n["setSize"](e, t)
  5104. };
  5105. window["cr_setSuspended"] = function(e) {
  5106. var t = window["cr_getC2Runtime"]();
  5107. if (t) t["setSuspended"](e)
  5108. };
  5109. (function() {
  5110. function e(e, t) {
  5111. this.runtime = e;
  5112. this.event_sheet = null;
  5113. this.scrollX = this.runtime.original_width / 2;
  5114. this.scrollY = this.runtime.original_height / 2;
  5115. this.scale = 1;
  5116. this.angle = 0;
  5117. this.first_visit = true;
  5118. this.name = t[0];
  5119. this.width = t[1];
  5120. this.height = t[2];
  5121. this.unbounded_scrolling = t[3];
  5122. this.sheetname = t[4];
  5123. this.sid = t[5];
  5124. var n = t[6];
  5125. var r, i;
  5126. this.layers = [];
  5127. this.initial_types = [];
  5128. for (r = 0, i = n.length; r < i; r++) {
  5129. var s = new cr.layer(this, n[r]);
  5130. s.number = r;
  5131. cr.seal(s);
  5132. this.layers.push(s)
  5133. }
  5134. var o = t[7];
  5135. this.initial_nonworld = [];
  5136. for (r = 0, i = o.length; r < i; r++) {
  5137. var u = o[r];
  5138. var a = this.runtime.types_by_index[u[1]];
  5139. if (!a.default_instance) a.default_instance = u;
  5140. this.initial_nonworld.push(u);
  5141. if (this.initial_types.indexOf(a) === -1) this.initial_types.push(a)
  5142. }
  5143. this.effect_types = [];
  5144. this.active_effect_types = [];
  5145. this.effect_params = [];
  5146. for (r = 0, i = t[8].length; r < i; r++) {
  5147. this.effect_types.push({
  5148. id: t[8][r][0],
  5149. name: t[8][r][1],
  5150. shaderindex: -1,
  5151. active: true,
  5152. index: r
  5153. });
  5154. this.effect_params.push(t[8][r][2].slice(0))
  5155. }
  5156. this.updateActiveEffects();
  5157. this.rcTex = new cr.rect(0, 0, 1, 1);
  5158. this.rcTex2 = new cr.rect(0, 0, 1, 1);
  5159. this.persist_data = {}
  5160. }
  5161. function n(e, t) {
  5162. this.layout = e;
  5163. this.runtime = e.runtime;
  5164. this.instances = [];
  5165. this.scale = 1;
  5166. this.angle = 0;
  5167. this.disableAngle = false;
  5168. this.tmprect = new cr.rect(0, 0, 0, 0);
  5169. this.tmpquad = new cr.quad;
  5170. this.viewLeft = 0;
  5171. this.viewRight = 0;
  5172. this.viewTop = 0;
  5173. this.viewBottom = 0;
  5174. this.zindices_stale = false;
  5175. this.name = t[0];
  5176. this.index = t[1];
  5177. this.sid = t[2];
  5178. this.visible = t[3];
  5179. this.background_color = t[4];
  5180. this.transparent = t[5];
  5181. this.parallaxX = t[6];
  5182. this.parallaxY = t[7];
  5183. this.opacity = t[8];
  5184. this.forceOwnTexture = t[9];
  5185. this.zoomRate = t[10];
  5186. this.blend_mode = t[11];
  5187. this.effect_fallback = t[12];
  5188. this.compositeOp = "source-over";
  5189. this.srcBlend = 0;
  5190. this.destBlend = 0;
  5191. this.render_offscreen = false;
  5192. var n = t[13];
  5193. var r, i;
  5194. this.initial_instances = [];
  5195. for (r = 0, i = n.length; r < i; r++) {
  5196. var s = n[r];
  5197. var o = this.runtime.types_by_index[s[1]];
  5198. if (!o.default_instance) o.default_instance = s;
  5199. this.initial_instances.push(s);
  5200. if (this.layout.initial_types.indexOf(o) === -1) this.layout.initial_types.push(o)
  5201. }
  5202. this.effect_types = [];
  5203. this.active_effect_types = [];
  5204. this.effect_params = [];
  5205. for (r = 0, i = t[14].length; r < i; r++) {
  5206. this.effect_types.push({
  5207. id: t[14][r][0],
  5208. name: t[14][r][1],
  5209. shaderindex: -1,
  5210. active: true,
  5211. index: r
  5212. });
  5213. this.effect_params.push(t[14][r][2].slice(0))
  5214. }
  5215. this.updateActiveEffects();
  5216. this.rcTex = new cr.rect(0, 0, 1, 1);
  5217. this.rcTex2 = new cr.rect(0, 0, 1, 1)
  5218. }
  5219. function r(e, t) {
  5220. return e.zindex - t.zindex
  5221. }
  5222. e.prototype.saveObjectToPersist = function(e) {
  5223. var t = e.type.sid.toString();
  5224. if (!this.persist_data.hasOwnProperty(t)) this.persist_data[t] = [];
  5225. var n = this.persist_data[t];
  5226. n.push(this.runtime.saveInstanceToJSON(e))
  5227. };
  5228. e.prototype.hasOpaqueBottomLayer = function() {
  5229. var e = this.layers[0];
  5230. return !e.transparent && e.opacity === 1 && !e.forceOwnTexture && e.visible
  5231. };
  5232. e.prototype.updateActiveEffects = function() {
  5233. this.active_effect_types.length = 0;
  5234. var e, t, n;
  5235. for (e = 0, t = this.effect_types.length; e < t; e++) {
  5236. n = this.effect_types[e];
  5237. if (n.active) this.active_effect_types.push(n)
  5238. }
  5239. };
  5240. e.prototype.getEffectByName = function(e) {
  5241. var t, n, r;
  5242. for (t = 0, n = this.effect_types.length; t < n; t++) {
  5243. r = this.effect_types[t];
  5244. if (r.name === e) return r
  5245. }
  5246. return null
  5247. };
  5248. var t = [];
  5249. e.prototype.startRunning = function() {
  5250. if (this.sheetname) {
  5251. this.event_sheet = this.runtime.eventsheets[this.sheetname];
  5252. }
  5253. this.runtime.running_layout = this;
  5254. this.scrollX = this.runtime.original_width / 2;
  5255. this.scrollY = this.runtime.original_height / 2;
  5256. var e, n, i, s, o, u, a, f, l, c, h, p, d, v;
  5257. for (e = 0, i = this.runtime.types_by_index.length; e < i; e++) {
  5258. o = this.runtime.types_by_index[e];
  5259. if (o.is_family) continue;
  5260. u = o.instances;
  5261. for (n = 0, s = u.length; n < s; n++) {
  5262. a = u[n];
  5263. if (a.layer) {
  5264. var m = a.layer.number;
  5265. if (m >= this.layers.length) m = this.layers.length - 1;
  5266. a.layer = this.layers[m];
  5267. a.layer.instances.push(a);
  5268. a.layer.zindices_stale = true
  5269. }
  5270. }
  5271. }
  5272. var v;
  5273. t.length = 0;
  5274. this.boundScrolling();
  5275. for (e = 0, i = this.layers.length; e < i; e++) {
  5276. v = this.layers[e];
  5277. v.createInitialInstances();
  5278. v.disableAngle = true;
  5279. var g = v.canvasToLayer(0, 0, true);
  5280. var y = v.canvasToLayer(0, 0, false);
  5281. v.disableAngle = false;
  5282. if (this.runtime.pixel_rounding) {
  5283. g = g + .5 | 0;
  5284. y = y + .5 | 0
  5285. }
  5286. v.rotateViewport(g, y, null)
  5287. }
  5288. var b = false;
  5289. if (!this.first_visit) {
  5290. for (h in this.persist_data) {
  5291. if (this.persist_data.hasOwnProperty(h)) {
  5292. o = this.runtime.getObjectTypeBySid(parseInt(h, 10));
  5293. if (!o || o.is_family || !this.runtime.typeHasPersistBehavior(o)) continue;
  5294. d = this.persist_data[h];
  5295. for (e = 0, i = d.length; e < i; e++) {
  5296. v = null;
  5297. if (o.plugin.is_world) {
  5298. v = this.getLayerBySid(d[e]["w"]["l"]);
  5299. if (!v) continue
  5300. }
  5301. a = this.runtime.createInstanceFromInit(o.default_instance, v, false, 0, 0, true);
  5302. this.runtime.loadInstanceFromJSON(a, d[e]);
  5303. b = true;
  5304. t.push(a)
  5305. }
  5306. d.length = 0
  5307. }
  5308. }
  5309. for (e = 0, i = this.layers.length; e < i; e++) {
  5310. this.layers[e].instances.sort(r);
  5311. this.layers[e].zindices_stale = true
  5312. }
  5313. }
  5314. if (b) {
  5315. this.runtime.ClearDeathRow();
  5316. this.runtime.refreshUidMap()
  5317. }
  5318. for (e = 0; e < t.length; e++) {
  5319. a = t[e];
  5320. if (!a.type.is_contained) continue;
  5321. f = a.get_iid();
  5322. for (n = 0, s = a.type.container.length; n < s; n++) {
  5323. l = a.type.container[n];
  5324. if (a.type === l) continue;
  5325. if (l.instances.length > f) a.siblings.push(l.instances[f]);
  5326. else {
  5327. if (!l.default_instance) {} else {
  5328. c = this.runtime.createInstanceFromInit(l.default_instance, a.layer, true, a.x, a.y, true);
  5329. this.runtime.ClearDeathRow();
  5330. l.updateIIDs();
  5331. a.siblings.push(c);
  5332. t.push(c)
  5333. }
  5334. }
  5335. }
  5336. }
  5337. for (e = 0, i = this.initial_nonworld.length; e < i; e++) {
  5338. a = this.runtime.createInstanceFromInit(this.initial_nonworld[e], null, true);
  5339. }
  5340. this.runtime.changelayout = null;
  5341. this.runtime.ClearDeathRow();
  5342. if (this.runtime.ctx && !this.runtime.isDomFree) {
  5343. for (e = 0, i = this.runtime.types_by_index.length; e < i; e++) {
  5344. l = this.runtime.types_by_index[e];
  5345. if (l.is_family || !l.instances.length || !l.preloadCanvas2D) continue;
  5346. l.preloadCanvas2D(this.runtime.ctx)
  5347. }
  5348. }
  5349. for (e = 0, i = t.length; e < i; e++) {
  5350. a = t[e];
  5351. this.runtime.trigger(Object.getPrototypeOf(a.type.plugin).cnds.OnCreated, a)
  5352. }
  5353. t.length = 0;
  5354. this.runtime.trigger(cr.system_object.prototype.cnds.OnLayoutStart, null);
  5355. this.first_visit = false
  5356. };
  5357. e.prototype.createGlobalNonWorlds = function() {
  5358. var e, t, n, r, i, s;
  5359. for (e = 0, t = 0, n = this.initial_nonworld.length; e < n; e++) {
  5360. r = this.initial_nonworld[e];
  5361. s = this.runtime.types_by_index[r[1]];
  5362. if (s.global) i = this.runtime.createInstanceFromInit(r, null, true);
  5363. else {
  5364. this.initial_nonworld[t] = r;
  5365. t++
  5366. }
  5367. }
  5368. this.initial_nonworld.length = t
  5369. };
  5370. e.prototype.stopRunning = function() {
  5371. this.runtime.trigger(cr.system_object.prototype.cnds.OnLayoutEnd, null);
  5372. this.runtime.system.waits.length = 0;
  5373. var e, t, n, r;
  5374. var i, s, o;
  5375. for (e = 0, t = this.layers.length; e < t; e++) {
  5376. i = this.layers[e].instances;
  5377. for (n = 0, r = i.length; n < r; n++) {
  5378. s = i[n];
  5379. if (!s.type.global) {
  5380. if (this.runtime.typeHasPersistBehavior(s.type)) this.saveObjectToPersist(s);
  5381. this.runtime.DestroyInstance(s)
  5382. }
  5383. }
  5384. this.runtime.ClearDeathRow();
  5385. i.length = 0;
  5386. this.layers[e].zindices_stale = true
  5387. }
  5388. for (e = 0, t = this.runtime.types_by_index.length; e < t; e++) {
  5389. o = this.runtime.types_by_index[e];
  5390. if (o.global || o.plugin.is_world || o.plugin.singleglobal || o.is_family) continue;
  5391. for (n = 0, r = o.instances.length; n < r; n++) this.runtime.DestroyInstance(o.instances[n]);
  5392. this.runtime.ClearDeathRow()
  5393. }
  5394. };
  5395. e.prototype.draw = function(e) {
  5396. e.globalAlpha = 1;
  5397. e.globalCompositeOperation = "source-over";
  5398. if (this.runtime.clearBackground && !this.hasOpaqueBottomLayer()) e.clearRect(0, 0, this.runtime.width, this.runtime.height);
  5399. var t, n, r;
  5400. for (t = 0, n = this.layers.length; t < n; t++) {
  5401. r = this.layers[t];
  5402. if (r.visible && r.opacity > 0 && r.blend_mode !== 11) r.draw(e)
  5403. }
  5404. };
  5405. e.prototype.drawGL = function(e) {
  5406. var t = this.active_effect_types.length > 0 || this.runtime.uses_background_blending;
  5407. if (t) {
  5408. if (!this.runtime.layout_tex) {
  5409. this.runtime.layout_tex = e.createEmptyTexture(this.runtime.width, this.runtime.height, this.runtime.linearSampling)
  5410. }
  5411. if (this.runtime.layout_tex.c2width !== this.runtime.width || this.runtime.layout_tex.c2height !== this.runtime.height) {
  5412. e.deleteTexture(this.runtime.layout_tex);
  5413. this.runtime.layout_tex = e.createEmptyTexture(this.runtime.width, this.runtime.height, this.runtime.linearSampling)
  5414. }
  5415. e.setRenderingToTexture(this.runtime.layout_tex)
  5416. }
  5417. if (this.runtime.clearBackground && !this.hasOpaqueBottomLayer()) e.clear(0, 0, 0, 0);
  5418. var n, r;
  5419. for (n = 0, r = this.layers.length; n < r; n++) {
  5420. if (this.layers[n].visible && this.layers[n].opacity > 0) this.layers[n].drawGL(e)
  5421. }
  5422. if (t) {
  5423. if (this.active_effect_types.length <= 1) {
  5424. if (this.active_effect_types.length === 1) {
  5425. var i = this.active_effect_types[0].index;
  5426. e.switchProgram(this.active_effect_types[0].shaderindex);
  5427. e.setProgramParameters(null, 1 / this.runtime.width, 1 / this.runtime.height, 0, 0, 1, 1, this.scale, this.effect_params[i]);
  5428. if (e.programIsAnimated(this.active_effect_types[0].shaderindex)) this.runtime.redraw = true
  5429. } else e.switchProgram(0);
  5430. e.setRenderingToTexture(null);
  5431. e.setOpacity(1);
  5432. e.setTexture(this.runtime.layout_tex);
  5433. e.setAlphaBlend();
  5434. e.resetModelView();
  5435. e.updateModelView();
  5436. var s = this.runtime.width / 2;
  5437. var o = this.runtime.height / 2;
  5438. e.quad(-s, o, s, o, s, -o, -s, -o);
  5439. e.setTexture(null)
  5440. } else {
  5441. this.renderEffectChain(e, null, null, null)
  5442. }
  5443. }
  5444. };
  5445. e.prototype.getRenderTarget = function() {
  5446. return this.active_effect_types.length > 0 || this.runtime.uses_background_blending ? this.runtime.layout_tex : null
  5447. };
  5448. e.prototype.getMinLayerScale = function() {
  5449. var e = this.layers[0].getScale();
  5450. var t, n, r;
  5451. for (t = 1, n = this.layers.length; t < n; t++) {
  5452. r = this.layers[t];
  5453. if (r.parallaxX === 0 && r.parallaxY === 0) continue;
  5454. if (r.getScale() < e) e = r.getScale()
  5455. }
  5456. return e
  5457. };
  5458. e.prototype.scrollToX = function(e) {
  5459. if (!this.unbounded_scrolling) {
  5460. var t = this.runtime.width * (1 / this.getMinLayerScale()) / 2;
  5461. if (e > this.width - t) e = this.width - t;
  5462. if (e < t) e = t
  5463. }
  5464. if (this.scrollX !== e) {
  5465. this.scrollX = e;
  5466. this.runtime.redraw = true
  5467. }
  5468. };
  5469. e.prototype.scrollToY = function(e) {
  5470. if (!this.unbounded_scrolling) {
  5471. var t = this.runtime.height * (1 / this.getMinLayerScale()) / 2;
  5472. if (e > this.height - t) e = this.height - t;
  5473. if (e < t) e = t
  5474. }
  5475. if (this.scrollY !== e) {
  5476. this.scrollY = e;
  5477. this.runtime.redraw = true
  5478. }
  5479. };
  5480. e.prototype.boundScrolling = function() {
  5481. this.scrollToX(this.scrollX);
  5482. this.scrollToY(this.scrollY)
  5483. };
  5484. e.prototype.renderEffectChain = function(e, t, n, r) {
  5485. var i = n ? n.active_effect_types : t ? t.active_effect_types : this.active_effect_types;
  5486. var s = n ? n.layer.getScale() : t ? t.getScale() : 1;
  5487. var o = this.runtime.fx_tex;
  5488. var u, a, f, l, c = 0,
  5489. h = 1;
  5490. var p, d;
  5491. var v = this.runtime.width;
  5492. var m = this.runtime.height;
  5493. var g = v / 2;
  5494. var y = m / 2;
  5495. var b = t ? t.rcTex : this.rcTex;
  5496. var w = t ? t.rcTex2 : this.rcTex2;
  5497. var E = 0,
  5498. S = 0;
  5499. var x = 0,
  5500. T = 0;
  5501. var N = v,
  5502. C = v;
  5503. var k = m,
  5504. L = m;
  5505. var A = 0;
  5506. var O = 0;
  5507. var M = n ? n.layer.getAngle() : 0;
  5508. if (n) {
  5509. for (u = 0, a = i.length; u < a; u++) {
  5510. A += e.getProgramBoxExtendHorizontal(i[u].shaderindex);
  5511. O += e.getProgramBoxExtendVertical(i[u].shaderindex)
  5512. }
  5513. var _ = n.bbox;
  5514. E = t.layerToCanvas(_.left, _.top, true);
  5515. x = t.layerToCanvas(_.left, _.top, false);
  5516. N = t.layerToCanvas(_.right, _.bottom, true);
  5517. k = t.layerToCanvas(_.right, _.bottom, false);
  5518. if (M !== 0) {
  5519. var D = t.layerToCanvas(_.right, _.top, true);
  5520. var P = t.layerToCanvas(_.right, _.top, false);
  5521. var H = t.layerToCanvas(_.left, _.bottom, true);
  5522. var B = t.layerToCanvas(_.left, _.bottom, false);
  5523. l = Math.min(E, N, D, H);
  5524. N = Math.max(E, N, D, H);
  5525. E = l;
  5526. l = Math.min(x, k, P, B);
  5527. k = Math.max(x, k, P, B);
  5528. x = l
  5529. }
  5530. E -= A;
  5531. x -= O;
  5532. N += A;
  5533. k += O;
  5534. w.left = E / v;
  5535. w.top = 1 - x / m;
  5536. w.right = N / v;
  5537. w.bottom = 1 - k / m;
  5538. S = E = Math.floor(E);
  5539. T = x = Math.floor(x);
  5540. C = N = Math.ceil(N);
  5541. L = k = Math.ceil(k);
  5542. S -= A;
  5543. T -= O;
  5544. C += A;
  5545. L += O;
  5546. if (E < 0) E = 0;
  5547. if (x < 0) x = 0;
  5548. if (N > v) N = v;
  5549. if (k > m) k = m;
  5550. if (S < 0) S = 0;
  5551. if (T < 0) T = 0;
  5552. if (C > v) C = v;
  5553. if (L > m) L = m;
  5554. b.left = E / v;
  5555. b.top = 1 - x / m;
  5556. b.right = N / v;
  5557. b.bottom = 1 - k / m
  5558. } else {
  5559. b.left = w.left = 0;
  5560. b.top = w.top = 0;
  5561. b.right = w.right = 1;
  5562. b.bottom = w.bottom = 1
  5563. }
  5564. 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;
  5565. e.setAlphaBlend();
  5566. if (j) {
  5567. if (!o[c]) {
  5568. o[c] = e.createEmptyTexture(v, m, this.runtime.linearSampling)
  5569. }
  5570. if (o[c].c2width !== v || o[c].c2height !== m) {
  5571. e.deleteTexture(o[c]);
  5572. o[c] = e.createEmptyTexture(v, m, this.runtime.linearSampling)
  5573. }
  5574. e.switchProgram(0);
  5575. e.setRenderingToTexture(o[c]);
  5576. d = L - T;
  5577. p = m - T - d;
  5578. e.clearRect(S, p, C - S, d);
  5579. if (n) {
  5580. n.drawGL(e)
  5581. } else {
  5582. e.setTexture(this.runtime.layer_tex);
  5583. e.setOpacity(t.opacity);
  5584. e.resetModelView();
  5585. e.translate(-g, -y);
  5586. e.updateModelView();
  5587. e.quadTex(E, k, N, k, N, x, E, x, b)
  5588. }
  5589. w.left = w.top = 0;
  5590. w.right = w.bottom = 1;
  5591. if (n) {
  5592. l = b.top;
  5593. b.top = b.bottom;
  5594. b.bottom = l
  5595. }
  5596. c = 1;
  5597. h = 0
  5598. }
  5599. e.setOpacity(1);
  5600. var f = i.length - 1;
  5601. var F = e.programUsesCrossSampling(i[f].shaderindex);
  5602. var I = 0;
  5603. for (u = 0, a = i.length; u < a; u++) {
  5604. if (!o[c]) {
  5605. o[c] = e.createEmptyTexture(v, m, this.runtime.linearSampling)
  5606. }
  5607. if (o[c].c2width !== v || o[c].c2height !== m) {
  5608. e.deleteTexture(o[c]);
  5609. o[c] = e.createEmptyTexture(v, m, this.runtime.linearSampling)
  5610. }
  5611. e.switchProgram(i[u].shaderindex);
  5612. I = i[u].index;
  5613. if (e.programIsAnimated(i[u].shaderindex)) this.runtime.redraw = true;
  5614. if (u == 0 && !j) {
  5615. e.setRenderingToTexture(o[c]);
  5616. d = L - T;
  5617. p = m - T - d;
  5618. e.clearRect(S, p, C - S, d);
  5619. if (n) {
  5620. e.setProgramParameters(r, 1 / n.width, 1 / n.height, w.left, w.top, w.right, w.bottom, s, n.effect_params[I]);
  5621. n.drawGL(e)
  5622. } else {
  5623. e.setProgramParameters(r, 1 / v, 1 / m, 0, 0, 1, 1, s, t ? t.effect_params[I] : this.effect_params[I]);
  5624. e.setTexture(t ? this.runtime.layer_tex : this.runtime.layout_tex);
  5625. e.resetModelView();
  5626. e.translate(-g, -y);
  5627. e.updateModelView();
  5628. e.quadTex(E, k, N, k, N, x, E, x, b)
  5629. }
  5630. w.left = w.top = 0;
  5631. w.right = w.bottom = 1;
  5632. if (n && !F) {
  5633. l = k;
  5634. k = x;
  5635. x = l
  5636. }
  5637. } else {
  5638. 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]);
  5639. if (u === f && !F) {
  5640. if (n) e.setBlend(n.srcBlend, n.destBlend);
  5641. else if (t) e.setBlend(t.srcBlend, t.destBlend);
  5642. e.setRenderingToTexture(r)
  5643. } else {
  5644. e.setRenderingToTexture(o[c]);
  5645. d = L - T;
  5646. p = m - T - d;
  5647. e.clearRect(S, p, C - S, d)
  5648. }
  5649. e.setTexture(o[h]);
  5650. e.resetModelView();
  5651. e.translate(-g, -y);
  5652. e.updateModelView();
  5653. e.quadTex(E, k, N, k, N, x, E, x, b);
  5654. if (u === f && !F) e.setTexture(null)
  5655. }
  5656. c = c === 0 ? 1 : 0;
  5657. h = c === 0 ? 1 : 0
  5658. }
  5659. if (F) {
  5660. e.switchProgram(0);
  5661. if (n) e.setBlend(n.srcBlend, n.destBlend);
  5662. else if (t) e.setBlend(t.srcBlend, t.destBlend);
  5663. e.setRenderingToTexture(r);
  5664. e.setTexture(o[h]);
  5665. e.resetModelView();
  5666. e.translate(-g, -y);
  5667. e.updateModelView();
  5668. if (n && i.length === 1 && !j) e.quadTex(E, x, N, x, N, k, E, k, b);
  5669. else e.quadTex(E, k, N, k, N, x, E, x, b);
  5670. e.setTexture(null)
  5671. }
  5672. };
  5673. e.prototype.getLayerBySid = function(e) {
  5674. var t, n;
  5675. for (t = 0, n = this.layers.length; t < n; t++) {
  5676. if (this.layers[t].sid === e) return this.layers[t]
  5677. }
  5678. return null
  5679. };
  5680. e.prototype.saveToJSON = function() {
  5681. var e, t, n, r;
  5682. var i = {
  5683. sx: this.scrollX,
  5684. sy: this.scrollY,
  5685. s: this.scale,
  5686. a: this.angle,
  5687. w: this.width,
  5688. h: this.height,
  5689. fv: this.first_visit,
  5690. persist: this.persist_data,
  5691. fx: [],
  5692. layers: {}
  5693. };
  5694. for (e = 0, t = this.effect_types.length; e < t; e++) {
  5695. r = this.effect_types[e];
  5696. i["fx"].push({
  5697. name: r.name,
  5698. active: r.active,
  5699. params: this.effect_params[r.index]
  5700. })
  5701. }
  5702. for (e = 0, t = this.layers.length; e < t; e++) {
  5703. n = this.layers[e];
  5704. i["layers"][n.sid.toString()] = n.saveToJSON()
  5705. }
  5706. return i
  5707. };
  5708. e.prototype.loadFromJSON = function(e) {
  5709. var t, n, r, i, s;
  5710. this.scrollX = e["sx"];
  5711. this.scrollY = e["sy"];
  5712. this.scale = e["s"];
  5713. this.angle = e["a"];
  5714. this.width = e["w"];
  5715. this.height = e["h"];
  5716. this.persist_data = e["persist"];
  5717. if (typeof e["fv"] !== "undefined") this.first_visit = e["fv"];
  5718. var o = e["fx"];
  5719. for (t = 0, n = o.length; t < n; t++) {
  5720. r = this.getEffectByName(o[t]["name"]);
  5721. if (!r) continue;
  5722. r.active = o[t]["active"];
  5723. this.effect_params[r.index] = o[t]["params"]
  5724. }
  5725. this.updateActiveEffects();
  5726. var u = e["layers"];
  5727. for (i in u) {
  5728. if (u.hasOwnProperty(i)) {
  5729. s = this.getLayerBySid(parseInt(i, 10));
  5730. if (!s) continue;
  5731. s.loadFromJSON(u[i])
  5732. }
  5733. }
  5734. };
  5735. cr.layout = e;
  5736. n.prototype.updateActiveEffects = function() {
  5737. this.active_effect_types.length = 0;
  5738. var e, t, n;
  5739. for (e = 0, t = this.effect_types.length; e < t; e++) {
  5740. n = this.effect_types[e];
  5741. if (n.active) this.active_effect_types.push(n)
  5742. }
  5743. };
  5744. n.prototype.getEffectByName = function(e) {
  5745. var t, n, r;
  5746. for (t = 0, n = this.effect_types.length; t < n; t++) {
  5747. r = this.effect_types[t];
  5748. if (r.name === e) return r
  5749. }
  5750. return null
  5751. };
  5752. n.prototype.createInitialInstances = function() {
  5753. var e, n, r, i, s, o, u, a;
  5754. for (e = 0, n = 0, r = this.initial_instances.length; e < r; e++) {
  5755. s = this.initial_instances[e];
  5756. o = this.runtime.types_by_index[s[1]];
  5757. a = this.runtime.typeHasPersistBehavior(o);
  5758. u = true;
  5759. if (!a || this.layout.first_visit) {
  5760. i = this.runtime.createInstanceFromInit(s, this, true);
  5761. t.push(i);
  5762. if (i.type.global) u = false
  5763. }
  5764. if (u) {
  5765. this.initial_instances[n] = this.initial_instances[e];
  5766. n++
  5767. }
  5768. }
  5769. this.initial_instances.length = n;
  5770. this.runtime.ClearDeathRow();
  5771. if (!this.runtime.glwrap && this.effect_types.length) this.blend_mode = this.effect_fallback;
  5772. this.compositeOp = cr.effectToCompositeOp(this.blend_mode);
  5773. if (this.runtime.gl) cr.setGLBlend(this, this.blend_mode, this.runtime.gl)
  5774. };
  5775. n.prototype.updateZIndices = function() {
  5776. if (!this.zindices_stale) return;
  5777. var e, t;
  5778. for (e = 0, t = this.instances.length; e < t; e++) {
  5779. this.instances[e].zindex = e
  5780. }
  5781. this.zindices_stale = false
  5782. };
  5783. n.prototype.getScale = function() {
  5784. return this.getNormalScale() * this.runtime.aspect_scale
  5785. };
  5786. n.prototype.getNormalScale = function() {
  5787. return (this.scale * this.layout.scale - 1) * this.zoomRate + 1
  5788. };
  5789. n.prototype.getAngle = function() {
  5790. if (this.disableAngle) return 0;
  5791. return cr.clamp_angle(this.layout.angle + this.angle)
  5792. };
  5793. n.prototype.draw = function(e) {
  5794. this.render_offscreen = this.forceOwnTexture || this.opacity !== 1 || this.blend_mode !== 0;
  5795. var t = this.runtime.canvas;
  5796. var n = e;
  5797. e.globalAlpha = 1;
  5798. e.globalCompositeOperation = "source-over";
  5799. if (this.render_offscreen) {
  5800. if (!this.runtime.layer_canvas) {
  5801. this.runtime.layer_canvas = document.createElement("canvas");
  5802. t = this.runtime.layer_canvas;
  5803. t.width = this.runtime.width;
  5804. t.height = this.runtime.height;
  5805. this.runtime.layer_ctx = t.getContext("2d");
  5806. }
  5807. t = this.runtime.layer_canvas;
  5808. n = this.runtime.layer_ctx;
  5809. if (t.width !== this.runtime.width) t.width = this.runtime.width;
  5810. if (t.height !== this.runtime.height) t.height = this.runtime.height;
  5811. if (this.transparent) n.clearRect(0, 0, this.runtime.width, this.runtime.height)
  5812. }
  5813. if (!this.transparent) {
  5814. n.fillStyle = "rgb(" + this.background_color[0] + "," + this.background_color[1] + "," + this.background_color[2] + ")";
  5815. n.fillRect(0, 0, this.runtime.width, this.runtime.height)
  5816. }
  5817. n.save();
  5818. this.disableAngle = true;
  5819. var r = this.canvasToLayer(0, 0, true);
  5820. var i = this.canvasToLayer(0, 0, false);
  5821. this.disableAngle = false;
  5822. if (this.runtime.pixel_rounding) {
  5823. r = r + .5 | 0;
  5824. i = i + .5 | 0
  5825. }
  5826. this.rotateViewport(r, i, n);
  5827. var s = this.getScale();
  5828. n.scale(s, s);
  5829. n.translate(-r, -i);
  5830. var o, u, a, f;
  5831. for (o = 0, u = this.instances.length; o < u; o++) {
  5832. a = this.instances[o];
  5833. if (!a.visible || a.width === 0 || a.height === 0) continue;
  5834. a.update_bbox();
  5835. f = a.bbox;
  5836. if (f.right < this.viewLeft || f.bottom < this.viewTop || f.left > this.viewRight || f.top > this.viewBottom) continue;
  5837. n.globalCompositeOperation = a.compositeOp;
  5838. a.draw(n)
  5839. }
  5840. n.restore();
  5841. if (this.render_offscreen) {
  5842. e.globalCompositeOperation = this.compositeOp;
  5843. e.globalAlpha = this.opacity;
  5844. e.drawImage(t, 0, 0)
  5845. }
  5846. };
  5847. n.prototype.rotateViewport = function(e, t, n) {
  5848. var r = this.getScale();
  5849. this.viewLeft = e;
  5850. this.viewTop = t;
  5851. this.viewRight = e + this.runtime.width * (1 / r);
  5852. this.viewBottom = t + this.runtime.height * (1 / r);
  5853. var i = this.getAngle();
  5854. if (i !== 0) {
  5855. if (n) {
  5856. n.translate(this.runtime.width / 2, this.runtime.height / 2);
  5857. n.rotate(-i);
  5858. n.translate(this.runtime.width / -2, this.runtime.height / -2)
  5859. }
  5860. this.tmprect.set(this.viewLeft, this.viewTop, this.viewRight, this.viewBottom);
  5861. this.tmprect.offset((this.viewLeft + this.viewRight) / -2, (this.viewTop + this.viewBottom) / -2);
  5862. this.tmpquad.set_from_rotated_rect(this.tmprect, i);
  5863. this.tmpquad.bounding_box(this.tmprect);
  5864. this.tmprect.offset((this.viewLeft + this.viewRight) / 2, (this.viewTop + this.viewBottom) / 2);
  5865. this.viewLeft = this.tmprect.left;
  5866. this.viewTop = this.tmprect.top;
  5867. this.viewRight = this.tmprect.right;
  5868. this.viewBottom = this.tmprect.bottom
  5869. }
  5870. };
  5871. n.prototype.drawGL = function(e) {
  5872. var t = this.runtime.width;
  5873. var n = this.runtime.height;
  5874. var r = 0;
  5875. var i = 0;
  5876. this.render_offscreen = this.forceOwnTexture || this.opacity !== 1 || this.active_effect_types.length > 0 || this.blend_mode !== 0;
  5877. if (this.render_offscreen) {
  5878. if (!this.runtime.layer_tex) {
  5879. this.runtime.layer_tex = e.createEmptyTexture(this.runtime.width, this.runtime.height, this.runtime.linearSampling)
  5880. }
  5881. if (this.runtime.layer_tex.c2width !== this.runtime.width || this.runtime.layer_tex.c2height !== this.runtime.height) {
  5882. e.deleteTexture(this.runtime.layer_tex);
  5883. this.runtime.layer_tex = e.createEmptyTexture(this.runtime.width, this.runtime.height, this.runtime.linearSampling)
  5884. }
  5885. e.setRenderingToTexture(this.runtime.layer_tex);
  5886. if (this.transparent) e.clear(0, 0, 0, 0)
  5887. }
  5888. if (!this.transparent) {
  5889. e.clear(this.background_color[0] / 255, this.background_color[1] / 255, this.background_color[2] / 255, 1)
  5890. }
  5891. this.disableAngle = true;
  5892. var s = this.canvasToLayer(0, 0, true);
  5893. var o = this.canvasToLayer(0, 0, false);
  5894. this.disableAngle = false;
  5895. if (this.runtime.pixel_rounding) {
  5896. s = s + .5 | 0;
  5897. o = o + .5 | 0
  5898. }
  5899. this.rotateViewport(s, o, null);
  5900. var u = this.getScale();
  5901. e.resetModelView();
  5902. e.scale(u, u);
  5903. e.rotateZ(-this.getAngle());
  5904. e.translate((this.viewLeft + this.viewRight) / -2, (this.viewTop + this.viewBottom) / -2);
  5905. e.updateModelView();
  5906. var a, f, l, c;
  5907. for (a = 0, f = this.instances.length; a < f; a++) {
  5908. l = this.instances[a];
  5909. if (!l.visible || l.width === 0 || l.height === 0) continue;
  5910. l.update_bbox();
  5911. c = l.bbox;
  5912. if (c.right < this.viewLeft || c.bottom < this.viewTop || c.left > this.viewRight || c.top > this.viewBottom) continue;
  5913. if (l.uses_shaders) {
  5914. r = l.active_effect_types[0].shaderindex;
  5915. i = l.active_effect_types[0].index;
  5916. 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) {
  5917. e.switchProgram(r);
  5918. e.setBlend(l.srcBlend, l.destBlend);
  5919. if (e.programIsAnimated(r)) this.runtime.redraw = true;
  5920. var h = 0,
  5921. p = 0,
  5922. d = 0,
  5923. v = 0;
  5924. if (e.programUsesDest(r)) {
  5925. var c = l.bbox;
  5926. var m = this.layerToCanvas(c.left, c.top, true);
  5927. var g = this.layerToCanvas(c.left, c.top, false);
  5928. var y = this.layerToCanvas(c.right, c.bottom, true);
  5929. var b = this.layerToCanvas(c.right, c.bottom, false);
  5930. h = m / t;
  5931. p = 1 - g / n;
  5932. d = y / t;
  5933. v = 1 - b / n
  5934. }
  5935. 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]);
  5936. l.drawGL(e)
  5937. } else {
  5938. this.layout.renderEffectChain(e, this, l, this.render_offscreen ? this.runtime.layer_tex : this.layout.getRenderTarget());
  5939. e.resetModelView();
  5940. e.scale(u, u);
  5941. e.rotateZ(-this.getAngle());
  5942. e.translate((this.viewLeft + this.viewRight) / -2, (this.viewTop + this.viewBottom) / -2);
  5943. e.updateModelView()
  5944. }
  5945. } else {
  5946. e.switchProgram(0);
  5947. e.setBlend(l.srcBlend, l.destBlend);
  5948. l.drawGL(e)
  5949. }
  5950. }
  5951. if (this.render_offscreen) {
  5952. r = this.active_effect_types.length ? this.active_effect_types[0].shaderindex : 0;
  5953. i = this.active_effect_types.length ? this.active_effect_types[0].index : 0;
  5954. if (this.active_effect_types.length === 0 || this.active_effect_types.length === 1 && !e.programUsesCrossSampling(r) && this.opacity === 1) {
  5955. if (this.active_effect_types.length === 1) {
  5956. e.switchProgram(r);
  5957. e.setProgramParameters(this.layout.getRenderTarget(), 1 / this.runtime.width, 1 / this.runtime.height, 0, 0, 1, 1, this.getScale(), this.effect_params[i]);
  5958. if (e.programIsAnimated(r)) this.runtime.redraw = true
  5959. } else e.switchProgram(0);
  5960. e.setRenderingToTexture(this.layout.getRenderTarget());
  5961. e.setOpacity(this.opacity);
  5962. e.setTexture(this.runtime.layer_tex);
  5963. e.setBlend(this.srcBlend, this.destBlend);
  5964. e.resetModelView();
  5965. e.updateModelView();
  5966. var w = this.runtime.width / 2;
  5967. var E = this.runtime.height / 2;
  5968. e.quad(-w, E, w, E, w, -E, -w, -E);
  5969. e.setTexture(null)
  5970. } else {
  5971. this.layout.renderEffectChain(e, this, null, this.layout.getRenderTarget())
  5972. }
  5973. }
  5974. };
  5975. n.prototype.canvasToLayer = function(e, t, n) {
  5976. var r = this.runtime.devicePixelRatio;
  5977. if (this.runtime.isRetina && this.runtime.fullscreen_mode > 0) {
  5978. e *= r;
  5979. t *= r
  5980. }
  5981. var i = this.runtime.original_width / 2;
  5982. var s = this.runtime.original_height / 2;
  5983. var o = (this.layout.scrollX - i) * this.parallaxX + i;
  5984. var u = (this.layout.scrollY - s) * this.parallaxY + s;
  5985. var a = 1 / this.getScale();
  5986. o -= this.runtime.width * a / 2;
  5987. u -= this.runtime.height * a / 2;
  5988. o += e * a;
  5989. u += t * a;
  5990. var f = this.getAngle();
  5991. if (f !== 0) {
  5992. o -= this.layout.scrollX;
  5993. u -= this.layout.scrollY;
  5994. var l = Math.cos(f);
  5995. var c = Math.sin(f);
  5996. var h = o * l - u * c;
  5997. u = u * l + o * c;
  5998. o = h;
  5999. o += this.layout.scrollX;
  6000. u += this.layout.scrollY
  6001. }
  6002. return n ? o : u
  6003. };
  6004. n.prototype.layerToCanvas = function(e, t, n) {
  6005. var r = this.getAngle();
  6006. if (r !== 0) {
  6007. e -= this.layout.scrollX;
  6008. t -= this.layout.scrollY;
  6009. var i = Math.cos(-r);
  6010. var s = Math.sin(-r);
  6011. var o = e * i - t * s;
  6012. t = t * i + e * s;
  6013. e = o;
  6014. e += this.layout.scrollX;
  6015. t += this.layout.scrollY
  6016. }
  6017. var u = this.runtime.original_width / 2;
  6018. var a = this.runtime.original_height / 2;
  6019. var f = (this.layout.scrollX - u) * this.parallaxX + u;
  6020. var l = (this.layout.scrollY - a) * this.parallaxY + a;
  6021. var c = 1 / this.getScale();
  6022. f -= this.runtime.width * c / 2;
  6023. l -= this.runtime.height * c / 2;
  6024. f = (e - f) / c;
  6025. l = (t - l) / c;
  6026. var h = this.runtime.devicePixelRatio;
  6027. if (this.runtime.isRetina && this.runtime.fullscreen_mode > 0) {
  6028. f /= h;
  6029. l /= h
  6030. }
  6031. return n ? f : l
  6032. };
  6033. n.prototype.rotatePt = function(e, t, n) {
  6034. if (this.getAngle() === 0) return n ? e : t;
  6035. var r = this.layerToCanvas(e, t, true);
  6036. var i = this.layerToCanvas(e, t, false);
  6037. this.disableAngle = true;
  6038. var s = this.canvasToLayer(r, i, true);
  6039. var o = this.canvasToLayer(r, i, true);
  6040. this.disableAngle = false;
  6041. return n ? s : o
  6042. };
  6043. n.prototype.saveToJSON = function() {
  6044. var e, t, n;
  6045. var r = {
  6046. s: this.scale,
  6047. a: this.angle,
  6048. vl: this.viewLeft,
  6049. vt: this.viewTop,
  6050. vr: this.viewRight,
  6051. vb: this.viewBottom,
  6052. v: this.visible,
  6053. bc: this.background_color,
  6054. t: this.transparent,
  6055. px: this.parallaxX,
  6056. py: this.parallaxY,
  6057. o: this.opacity,
  6058. zr: this.zoomRate,
  6059. fx: [],
  6060. instances: []
  6061. };
  6062. for (e = 0, t = this.effect_types.length; e < t; e++) {
  6063. n = this.effect_types[e];
  6064. r["fx"].push({
  6065. name: n.name,
  6066. active: n.active,
  6067. params: this.effect_params[n.index]
  6068. })
  6069. }
  6070. return r
  6071. };
  6072. n.prototype.loadFromJSON = function(e) {
  6073. var t, n, i, s, o;
  6074. this.scale = e["s"];
  6075. this.angle = e["a"];
  6076. this.viewLeft = e["vl"];
  6077. this.viewTop = e["vt"];
  6078. this.viewRight = e["vr"];
  6079. this.viewBottom = e["vb"];
  6080. this.visible = e["v"];
  6081. this.background_color = e["bc"];
  6082. this.transparent = e["t"];
  6083. this.parallaxX = e["px"];
  6084. this.parallaxY = e["py"];
  6085. this.opacity = e["o"];
  6086. this.zoomRate = e["zr"];
  6087. var u = e["fx"];
  6088. for (t = 0, n = u.length; t < n; t++) {
  6089. o = this.getEffectByName(u[t]["name"]);
  6090. if (!o) continue;
  6091. o.active = u[t]["active"];
  6092. this.effect_params[o.index] = u[t]["params"]
  6093. }
  6094. this.updateActiveEffects();
  6095. this.instances.sort(r);
  6096. this.zindices_stale = true
  6097. };
  6098. cr.layer = n
  6099. })();
  6100. (function() {
  6101. function t(e, t) {
  6102. var n, r = e.length;
  6103. switch (r) {
  6104. case 0:
  6105. return true;
  6106. case 1:
  6107. return e[0] === t[0];
  6108. case 2:
  6109. return e[0] === t[0] && e[1] === t[1];
  6110. default:
  6111. for (n = 0; n < r; n++) {
  6112. if (e[n] !== t[n]) return false
  6113. }
  6114. return true
  6115. }
  6116. }
  6117. function n(e, t) {
  6118. return e.index - t.index
  6119. }
  6120. function r(r) {
  6121. var i, s, o, u, a;
  6122. if (r.length === 2) {
  6123. if (r[0].index > r[1].index) {
  6124. u = r[0];
  6125. r[0] = r[1];
  6126. r[1] = u
  6127. }
  6128. } else if (r.length > 2) r.sort(n);
  6129. if (r.length >= e.length) e.length = r.length + 1;
  6130. if (!e[r.length]) e[r.length] = [];
  6131. a = e[r.length];
  6132. for (i = 0, s = a.length; i < s; i++) {
  6133. o = a[i];
  6134. if (t(r, o)) return o
  6135. }
  6136. a.push(r);
  6137. return r
  6138. }
  6139. function i(e, t) {
  6140. this.runtime = e;
  6141. this.triggers = {};
  6142. this.fasttriggers = {};
  6143. this.hasRun = false;
  6144. this.includes = new cr.ObjectSet;
  6145. this.name = t[0];
  6146. var n = t[1];
  6147. this.events = [];
  6148. var r, i;
  6149. for (r = 0, i = n.length; r < i; r++) this.init_event(n[r], null, this.events)
  6150. }
  6151. function s(e) {
  6152. this.type = e;
  6153. this.instances = [];
  6154. this.else_instances = [];
  6155. this.select_all = true
  6156. }
  6157. function o(e, t, n) {
  6158. this.sheet = e;
  6159. this.parent = t;
  6160. this.runtime = e.runtime;
  6161. this.solModifiers = [];
  6162. this.solModifiersIncludingParents = [];
  6163. this.solWriterAfterCnds = false;
  6164. this.group = false;
  6165. this.initially_activated = false;
  6166. this.toplevelevent = false;
  6167. this.toplevelgroup = false;
  6168. this.has_else_block = false;
  6169. this.conditions = [];
  6170. this.actions = [];
  6171. this.subevents = [];
  6172. if (n[1]) {
  6173. this.group_name = n[1][1].toLowerCase();
  6174. this.group = true;
  6175. this.initially_activated = !!n[1][0];
  6176. this.runtime.allGroups.push(this);
  6177. this.runtime.activeGroups[this.group_name.toLowerCase()] = this.initially_activated
  6178. } else {
  6179. this.group_name = "";
  6180. this.group = false;
  6181. this.initially_activated = false
  6182. }
  6183. this.orblock = n[2];
  6184. this.sid = n[4];
  6185. if (!this.group) this.runtime.blocksBySid[this.sid.toString()] = this;
  6186. var r, i;
  6187. var s = n[5];
  6188. for (r = 0, i = s.length; r < i; r++) {
  6189. var o = new cr.condition(this, s[r]);
  6190. o.index = r;
  6191. cr.seal(o);
  6192. this.conditions.push(o);
  6193. this.addSolModifier(o.type)
  6194. }
  6195. var u = n[6];
  6196. for (r = 0, i = u.length; r < i; r++) {
  6197. var a = new cr.action(this, u[r]);
  6198. a.index = r;
  6199. cr.seal(a);
  6200. this.actions.push(a)
  6201. }
  6202. if (n.length === 8) {
  6203. var f = n[7];
  6204. for (r = 0, i = f.length; r < i; r++) this.sheet.init_event(f[r], this, this.subevents)
  6205. }
  6206. this.is_else_block = false;
  6207. if (this.conditions.length) {
  6208. this.is_else_block = this.conditions[0].type == null && this.conditions[0].func == cr.system_object.prototype.cnds.Else
  6209. }
  6210. }
  6211. function u(e, t) {
  6212. var n, r, i;
  6213. if (!e) return;
  6214. if (t.indexOf(e) === -1) t.push(e);
  6215. if (e.is_contained) {
  6216. for (n = 0, r = e.container.length; n < r; n++) {
  6217. i = e.container[n];
  6218. if (e === i) continue;
  6219. if (t.indexOf(i) === -1) t.push(i)
  6220. }
  6221. }
  6222. }
  6223. function a(e, t) {
  6224. this.block = e;
  6225. this.sheet = e.sheet;
  6226. this.runtime = e.runtime;
  6227. this.parameters = [];
  6228. this.results = [];
  6229. this.extra = {};
  6230. this.index = -1;
  6231. this.func = t[1];
  6232. this.trigger = t[3] > 0;
  6233. this.fasttrigger = t[3] === 2;
  6234. this.looping = t[4];
  6235. this.inverted = t[5];
  6236. this.isstatic = t[6];
  6237. this.sid = t[7];
  6238. this.runtime.cndsBySid[this.sid.toString()] = this;
  6239. if (t[0] === -1) {
  6240. this.type = null;
  6241. this.run = this.run_system;
  6242. this.behaviortype = null;
  6243. this.beh_index = -1
  6244. } else {
  6245. this.type = this.runtime.types_by_index[t[0]];
  6246. if (this.isstatic) this.run = this.run_static;
  6247. else this.run = this.run_object; if (t[2]) {
  6248. this.behaviortype = this.type.getBehaviorByName(t[2]);
  6249. this.beh_index = this.type.getBehaviorIndexByName(t[2]);
  6250. } else {
  6251. this.behaviortype = null;
  6252. this.beh_index = -1
  6253. } if (this.block.parent) this.block.parent.setSolWriterAfterCnds()
  6254. } if (this.fasttrigger) this.run = this.run_true;
  6255. if (t.length === 10) {
  6256. var n, r;
  6257. var i = t[9];
  6258. for (n = 0, r = i.length; n < r; n++) {
  6259. var s = new cr.parameter(this, i[n]);
  6260. cr.seal(s);
  6261. this.parameters.push(s)
  6262. }
  6263. this.results.length = i.length
  6264. }
  6265. }
  6266. function f(e, t) {
  6267. this.block = e;
  6268. this.sheet = e.sheet;
  6269. this.runtime = e.runtime;
  6270. this.parameters = [];
  6271. this.results = [];
  6272. this.extra = {};
  6273. this.index = -1;
  6274. this.func = t[1];
  6275. if (t[0] === -1) {
  6276. this.type = null;
  6277. this.run = this.run_system;
  6278. this.behaviortype = null;
  6279. this.beh_index = -1
  6280. } else {
  6281. this.type = this.runtime.types_by_index[t[0]];
  6282. this.run = this.run_object;
  6283. if (t[2]) {
  6284. this.behaviortype = this.type.getBehaviorByName(t[2]);
  6285. this.beh_index = this.type.getBehaviorIndexByName(t[2]);
  6286. } else {
  6287. this.behaviortype = null;
  6288. this.beh_index = -1
  6289. }
  6290. }
  6291. this.sid = t[3];
  6292. this.runtime.actsBySid[this.sid.toString()] = this;
  6293. if (t.length === 6) {
  6294. var n, r;
  6295. var i = t[5];
  6296. for (n = 0, r = i.length; n < r; n++) {
  6297. var s = new cr.parameter(this, i[n]);
  6298. cr.seal(s);
  6299. this.parameters.push(s)
  6300. }
  6301. this.results.length = i.length
  6302. }
  6303. }
  6304. function h(e, t) {
  6305. this.owner = e;
  6306. this.block = e.block;
  6307. this.sheet = e.sheet;
  6308. this.runtime = e.runtime;
  6309. this.type = t[0];
  6310. this.expression = null;
  6311. this.solindex = 0;
  6312. this.combosel = 0;
  6313. this.layout = null;
  6314. this.key = 0;
  6315. this.object = null;
  6316. this.index = 0;
  6317. this.varname = null;
  6318. this.eventvar = null;
  6319. this.fileinfo = null;
  6320. this.subparams = null;
  6321. this.variadicret = null;
  6322. var n, r, i;
  6323. switch (t[0]) {
  6324. case 0:
  6325. case 7:
  6326. this.expression = new cr.expNode(this, t[1]);
  6327. this.solindex = 0;
  6328. this.get = this.get_exp;
  6329. break;
  6330. case 1:
  6331. this.expression = new cr.expNode(this, t[1]);
  6332. this.solindex = 0;
  6333. this.get = this.get_exp_str;
  6334. break;
  6335. case 5:
  6336. this.expression = new cr.expNode(this, t[1]);
  6337. this.solindex = 0;
  6338. this.get = this.get_layer;
  6339. break;
  6340. case 3:
  6341. case 8:
  6342. this.combosel = t[1];
  6343. this.get = this.get_combosel;
  6344. break;
  6345. case 6:
  6346. this.layout = this.runtime.layouts[t[1]];
  6347. this.get = this.get_layout;
  6348. break;
  6349. case 9:
  6350. this.key = t[1];
  6351. this.get = this.get_key;
  6352. break;
  6353. case 4:
  6354. this.object = this.runtime.types_by_index[t[1]];
  6355. this.get = this.get_object;
  6356. this.block.addSolModifier(this.object);
  6357. if (this.owner instanceof cr.action) this.block.setSolWriterAfterCnds();
  6358. else if (this.block.parent) this.block.parent.setSolWriterAfterCnds();
  6359. break;
  6360. case 10:
  6361. this.index = t[1];
  6362. if (e.type.is_family) this.get = this.get_familyvar;
  6363. else this.get = this.get_instvar;
  6364. break;
  6365. case 11:
  6366. this.varname = t[1];
  6367. this.eventvar = null;
  6368. this.get = this.get_eventvar;
  6369. break;
  6370. case 2:
  6371. case 12:
  6372. this.fileinfo = t[1];
  6373. this.get = this.get_audiofile;
  6374. break;
  6375. case 13:
  6376. this.get = this.get_variadic;
  6377. this.subparams = [];
  6378. this.variadicret = [];
  6379. for (n = 1, r = t.length; n < r; n++) {
  6380. i = new cr.parameter(this.owner, t[n]);
  6381. cr.seal(i);
  6382. this.subparams.push(i);
  6383. this.variadicret.push(0)
  6384. }
  6385. break;
  6386. default:
  6387. }
  6388. }
  6389. function p(e, t, n) {
  6390. this.sheet = e;
  6391. this.parent = t;
  6392. this.runtime = e.runtime;
  6393. this.solModifiers = [];
  6394. this.name = n[1];
  6395. this.vartype = n[2];
  6396. this.initial = n[3];
  6397. this.is_static = !!n[4];
  6398. this.is_constant = !!n[5];
  6399. this.sid = n[6];
  6400. this.runtime.varsBySid[this.sid.toString()] = this;
  6401. this.data = this.initial;
  6402. if (this.parent) {
  6403. if (this.is_static || this.is_constant) this.localIndex = -1;
  6404. else this.localIndex = this.runtime.stackLocalCount++;
  6405. this.runtime.all_local_vars.push(this)
  6406. } else {
  6407. this.localIndex = -1;
  6408. this.runtime.all_global_vars.push(this)
  6409. }
  6410. }
  6411. function d(e, t, n) {
  6412. this.sheet = e;
  6413. this.parent = t;
  6414. this.runtime = e.runtime;
  6415. this.solModifiers = [];
  6416. this.include_sheet = null;
  6417. this.include_sheet_name = n[1]
  6418. }
  6419. function v() {
  6420. this.temp_parents_arr = [];
  6421. this.reset(null);
  6422. cr.seal(this)
  6423. }
  6424. var e = [];
  6425. i.prototype.toString = function() {
  6426. return this.name
  6427. };
  6428. i.prototype.init_event = function(e, t, n) {
  6429. switch (e[0]) {
  6430. case 0:
  6431. {
  6432. var r = new cr.eventblock(this, t, e);
  6433. cr.seal(r);
  6434. if (r.orblock) {
  6435. n.push(r);
  6436. var i, s;
  6437. for (i = 0, s = r.conditions.length; i < s; i++) {
  6438. if (r.conditions[i].trigger) this.init_trigger(r, i)
  6439. }
  6440. } else {
  6441. if (r.is_trigger()) this.init_trigger(r, 0);
  6442. else n.push(r)
  6443. }
  6444. break
  6445. };
  6446. case 1:
  6447. {
  6448. var o = new cr.eventvariable(this, t, e);
  6449. cr.seal(o);
  6450. n.push(o);
  6451. break
  6452. };
  6453. case 2:
  6454. {
  6455. var u = new cr.eventinclude(this, t, e);
  6456. cr.seal(u);
  6457. n.push(u);
  6458. break
  6459. };
  6460. default:
  6461. }
  6462. };
  6463. i.prototype.postInit = function() {
  6464. var e, t;
  6465. for (e = 0, t = this.events.length; e < t; e++) {
  6466. this.events[e].postInit(e < t - 1 && this.events[e + 1].is_else_block)
  6467. }
  6468. };
  6469. i.prototype.run = function(e) {
  6470. if (!this.runtime.resuming_breakpoint) {
  6471. this.hasRun = true;
  6472. if (!e) this.runtime.isRunningEvents = true
  6473. }
  6474. var t, n;
  6475. for (t = 0, n = this.events.length; t < n; t++) {
  6476. var r = this.events[t];
  6477. r.run();
  6478. this.runtime.clearSol(r.solModifiers);
  6479. if (!this.runtime.deathRow.isEmpty() || this.runtime.createRow.length) this.runtime.ClearDeathRow()
  6480. }
  6481. if (!e) this.runtime.isRunningEvents = false
  6482. };
  6483. i.prototype.init_trigger = function(e, t) {
  6484. if (!e.orblock) this.runtime.triggers_to_postinit.push(e);
  6485. var n, r;
  6486. var i = e.conditions[t];
  6487. var s;
  6488. if (i.type) s = i.type.name;
  6489. else s = "system";
  6490. var o = i.fasttrigger;
  6491. var u = o ? this.fasttriggers : this.triggers;
  6492. if (!u[s]) u[s] = [];
  6493. var a = u[s];
  6494. var f = i.func;
  6495. if (o) {
  6496. if (!i.parameters.length) return;
  6497. var l = i.parameters[0];
  6498. if (l.type !== 1 || l.expression.type !== 2) {
  6499. return
  6500. }
  6501. var c;
  6502. var h = l.expression.value.toLowerCase();
  6503. var n, r;
  6504. for (n = 0, r = a.length; n < r; n++) {
  6505. if (a[n].method == f) {
  6506. c = a[n].evs;
  6507. if (!c[h]) c[h] = [
  6508. [e, t]
  6509. ];
  6510. else c[h].push([e, t]);
  6511. return
  6512. }
  6513. }
  6514. c = {};
  6515. c[h] = [
  6516. [e, t]
  6517. ];
  6518. a.push({
  6519. method: f,
  6520. evs: c
  6521. })
  6522. } else {
  6523. for (n = 0, r = a.length; n < r; n++) {
  6524. if (a[n].method == f) {
  6525. a[n].evs.push([e, t]);
  6526. return
  6527. }
  6528. }
  6529. a.push({
  6530. method: f,
  6531. evs: [
  6532. [e, t]
  6533. ]
  6534. })
  6535. }
  6536. };
  6537. cr.eventsheet = i;
  6538. s.prototype.hasObjects = function() {
  6539. if (this.select_all) return this.type.instances.length;
  6540. else return this.instances.length
  6541. };
  6542. s.prototype.getObjects = function() {
  6543. if (this.select_all) return this.type.instances;
  6544. else return this.instances
  6545. };
  6546. s.prototype.pick_one = function(e) {
  6547. if (!e) return;
  6548. if (e.runtime.getCurrentEventStack().current_event.orblock) {
  6549. if (this.select_all) {
  6550. this.instances.length = 0;
  6551. cr.shallowAssignArray(this.else_instances, e.type.instances);
  6552. this.select_all = false
  6553. }
  6554. var t = this.else_instances.indexOf(e);
  6555. if (t !== -1) {
  6556. this.instances.push(this.else_instances[t]);
  6557. this.else_instances.splice(t, 1)
  6558. }
  6559. } else {
  6560. this.select_all = false;
  6561. this.instances.length = 1;
  6562. this.instances[0] = e
  6563. }
  6564. };
  6565. cr.selection = s;
  6566. o.prototype.postInit = function(e) {
  6567. var t, n;
  6568. var i = this.parent;
  6569. if (this.group) {
  6570. this.toplevelgroup = true;
  6571. while (i) {
  6572. if (!i.group) {
  6573. this.toplevelgroup = false;
  6574. break
  6575. }
  6576. i = i.parent
  6577. }
  6578. }
  6579. this.toplevelevent = !this.is_trigger() && (!this.parent || this.parent.group && this.parent.toplevelgroup);
  6580. this.has_else_block = !!e;
  6581. this.solModifiersIncludingParents = this.solModifiers.slice(0);
  6582. i = this.parent;
  6583. while (i) {
  6584. for (t = 0, n = i.solModifiers.length; t < n; t++) this.addParentSolModifier(i.solModifiers[t]);
  6585. i = i.parent
  6586. }
  6587. this.solModifiers = r(this.solModifiers);
  6588. this.solModifiersIncludingParents = r(this.solModifiersIncludingParents);
  6589. var t, n;
  6590. for (t = 0, n = this.conditions.length; t < n; t++) this.conditions[t].postInit();
  6591. for (t = 0, n = this.actions.length; t < n; t++) this.actions[t].postInit();
  6592. for (t = 0, n = this.subevents.length; t < n; t++) {
  6593. this.subevents[t].postInit(t < n - 1 && this.subevents[t + 1].is_else_block)
  6594. }
  6595. };
  6596. o.prototype.addSolModifier = function(e) {
  6597. u(e, this.solModifiers)
  6598. };
  6599. o.prototype.addParentSolModifier = function(e) {
  6600. u(e, this.solModifiersIncludingParents)
  6601. };
  6602. o.prototype.setSolWriterAfterCnds = function() {
  6603. this.solWriterAfterCnds = true;
  6604. if (this.parent) this.parent.setSolWriterAfterCnds()
  6605. };
  6606. o.prototype.is_trigger = function() {
  6607. if (!this.conditions.length) return false;
  6608. else return this.conditions[0].trigger
  6609. };
  6610. o.prototype.run = function() {
  6611. var e, t, n = false,
  6612. r;
  6613. var i = this.runtime.getCurrentEventStack();
  6614. i.current_event = this;
  6615. if (!this.is_else_block) i.else_branch_ran = false;
  6616. if (this.orblock) {
  6617. if (this.conditions.length === 0) n = true;
  6618. i.cndindex = 0;
  6619. for (t = this.conditions.length; i.cndindex < t; i.cndindex++) {
  6620. if (this.conditions[i.cndindex].trigger) continue;
  6621. r = this.conditions[i.cndindex].run();
  6622. if (r) n = true
  6623. }
  6624. i.last_event_true = n;
  6625. if (n) this.run_actions_and_subevents()
  6626. } else {
  6627. i.cndindex = 0;
  6628. for (t = this.conditions.length; i.cndindex < t; i.cndindex++) {
  6629. r = this.conditions[i.cndindex].run();
  6630. if (!r) {
  6631. i.last_event_true = false;
  6632. if (this.toplevelevent && (!this.runtime.deathRow.isEmpty() || this.runtime.createRow.length)) this.runtime.ClearDeathRow();
  6633. return
  6634. }
  6635. }
  6636. i.last_event_true = true;
  6637. this.run_actions_and_subevents()
  6638. }
  6639. this.end_run(i)
  6640. };
  6641. o.prototype.end_run = function(e) {
  6642. if (e.last_event_true && this.has_else_block) e.else_branch_ran = true;
  6643. if (this.toplevelevent && (!this.runtime.deathRow.isEmpty() || this.runtime.createRow.length)) this.runtime.ClearDeathRow()
  6644. };
  6645. o.prototype.run_orblocktrigger = function(e) {
  6646. var t = this.runtime.getCurrentEventStack();
  6647. t.current_event = this;
  6648. if (this.conditions[e].run()) {
  6649. this.run_actions_and_subevents()
  6650. }
  6651. };
  6652. o.prototype.run_actions_and_subevents = function() {
  6653. var e = this.runtime.getCurrentEventStack();
  6654. var t;
  6655. for (e.actindex = 0, t = this.actions.length; e.actindex < t; e.actindex++) {
  6656. if (this.actions[e.actindex].run()) return
  6657. }
  6658. this.run_subevents()
  6659. };
  6660. o.prototype.resume_actions_and_subevents = function() {
  6661. var e = this.runtime.getCurrentEventStack();
  6662. var t;
  6663. for (t = this.actions.length; e.actindex < t; e.actindex++) {
  6664. if (this.actions[e.actindex].run()) return
  6665. }
  6666. this.run_subevents()
  6667. };
  6668. o.prototype.run_subevents = function() {
  6669. if (!this.subevents.length) return;
  6670. var e, t, n, r;
  6671. var i = this.subevents.length - 1;
  6672. this.runtime.pushEventStack(this);
  6673. if (this.solWriterAfterCnds) {
  6674. for (e = 0, t = this.subevents.length; e < t; e++) {
  6675. n = this.subevents[e];
  6676. r = !this.toplevelgroup || !this.group && e < i;
  6677. if (r) this.runtime.pushCopySol(n.solModifiers);
  6678. n.run();
  6679. if (r) this.runtime.popSol(n.solModifiers);
  6680. else this.runtime.clearSol(n.solModifiers)
  6681. }
  6682. } else {
  6683. for (e = 0, t = this.subevents.length; e < t; e++) {
  6684. this.subevents[e].run()
  6685. }
  6686. }
  6687. this.runtime.popEventStack()
  6688. };
  6689. o.prototype.run_pretrigger = function() {
  6690. var e = this.runtime.getCurrentEventStack();
  6691. e.current_event = this;
  6692. var t = false;
  6693. var n, r;
  6694. for (e.cndindex = 0, r = this.conditions.length; e.cndindex < r; e.cndindex++) {
  6695. if (this.conditions[e.cndindex].run()) t = true;
  6696. else if (!this.orblock) return false
  6697. }
  6698. return this.orblock ? t : true
  6699. };
  6700. o.prototype.retrigger = function() {
  6701. this.runtime.execcount++;
  6702. var e = this.runtime.getCurrentEventStack().cndindex;
  6703. var t;
  6704. var n = this.runtime.pushEventStack(this);
  6705. if (!this.orblock) {
  6706. for (n.cndindex = e + 1, t = this.conditions.length; n.cndindex < t; n.cndindex++) {
  6707. if (!this.conditions[n.cndindex].run()) {
  6708. this.runtime.popEventStack();
  6709. return false
  6710. }
  6711. }
  6712. }
  6713. this.run_actions_and_subevents();
  6714. this.runtime.popEventStack();
  6715. return true
  6716. };
  6717. o.prototype.isFirstConditionOfType = function(e) {
  6718. var t = e.index;
  6719. if (t === 0) return true;
  6720. --t;
  6721. for (; t >= 0; --t) {
  6722. if (this.conditions[t].type === e.type) return false
  6723. }
  6724. return true
  6725. };
  6726. cr.eventblock = o;
  6727. a.prototype.postInit = function() {
  6728. var e, t;
  6729. for (e = 0, t = this.parameters.length; e < t; e++) this.parameters[e].postInit()
  6730. };
  6731. a.prototype.run_true = function() {
  6732. return true
  6733. };
  6734. a.prototype.run_system = function() {
  6735. var e, t;
  6736. for (e = 0, t = this.parameters.length; e < t; e++) this.results[e] = this.parameters[e].get();
  6737. return cr.xor(this.func.apply(this.runtime.system, this.results), this.inverted)
  6738. };
  6739. a.prototype.run_static = function() {
  6740. var e, t;
  6741. for (e = 0, t = this.parameters.length; e < t; e++) this.results[e] = this.parameters[e].get(e);
  6742. var n = this.func.apply(this.behaviortype ? this.behaviortype : this.type, this.results);
  6743. this.type.applySolToContainer();
  6744. return n
  6745. };
  6746. a.prototype.run_object = function() {
  6747. var e, t, n, r, i, s, o, u, a;
  6748. var f = this.type.getCurrentSol();
  6749. var l = this.block.orblock && !this.trigger;
  6750. var c = 0;
  6751. var h = this.type.is_contained;
  6752. if (f.select_all) {
  6753. f.instances.length = 0;
  6754. f.else_instances.length = 0;
  6755. for (e = 0, n = this.type.instances.length; e < n; e++) {
  6756. o = this.type.instances[e];
  6757. for (t = 0, r = this.parameters.length; t < r; t++) this.results[t] = this.parameters[t].get(e);
  6758. if (this.beh_index > -1) {
  6759. if (this.type.is_family) {
  6760. c = o.type.family_beh_map[this.type.family_index]
  6761. }
  6762. i = this.func.apply(o.behavior_insts[this.beh_index + c], this.results)
  6763. } else i = this.func.apply(o, this.results);
  6764. s = cr.xor(i, this.inverted);
  6765. if (s) f.instances.push(o);
  6766. else if (l) f.else_instances.push(o)
  6767. }
  6768. if (this.type.finish) this.type.finish(true);
  6769. f.select_all = false;
  6770. this.type.applySolToContainer();
  6771. return f.hasObjects()
  6772. } else {
  6773. var p = 0;
  6774. var d = l && !this.block.isFirstConditionOfType(this);
  6775. var v = d ? f.else_instances : f.instances;
  6776. var m = false;
  6777. for (e = 0, n = v.length; e < n; e++) {
  6778. o = v[e];
  6779. for (t = 0, r = this.parameters.length; t < r; t++) this.results[t] = this.parameters[t].get(e);
  6780. if (this.beh_index > -1) {
  6781. if (this.type.is_family) {
  6782. c = o.type.family_beh_map[this.type.family_index]
  6783. }
  6784. i = this.func.apply(o.behavior_insts[this.beh_index + c], this.results)
  6785. } else i = this.func.apply(o, this.results); if (cr.xor(i, this.inverted)) {
  6786. m = true;
  6787. if (d) {
  6788. f.instances.push(o);
  6789. if (h) {
  6790. for (t = 0, r = o.siblings.length; t < r; t++) {
  6791. u = o.siblings[t];
  6792. u.type.getCurrentSol().instances.push(u)
  6793. }
  6794. }
  6795. } else {
  6796. v[p] = o;
  6797. if (h) {
  6798. for (t = 0, r = o.siblings.length; t < r; t++) {
  6799. u = o.siblings[t];
  6800. u.type.getCurrentSol().instances[p] = u
  6801. }
  6802. }
  6803. p++
  6804. }
  6805. } else {
  6806. if (d) {
  6807. v[p] = o;
  6808. if (h) {
  6809. for (t = 0, r = o.siblings.length; t < r; t++) {
  6810. u = o.siblings[t];
  6811. u.type.getCurrentSol().else_instances[p] = u
  6812. }
  6813. }
  6814. p++
  6815. } else if (l) {
  6816. f.else_instances.push(o);
  6817. if (h) {
  6818. for (t = 0, r = o.siblings.length; t < r; t++) {
  6819. u = o.siblings[t];
  6820. u.type.getCurrentSol().else_instances.push(u)
  6821. }
  6822. }
  6823. }
  6824. }
  6825. }
  6826. v.length = p;
  6827. if (h) {
  6828. for (e = 0, n = this.type.container.length; e < n; e++) {
  6829. a = this.type.container[e].getCurrentSol();
  6830. if (d) a.else_instances.length = p;
  6831. else a.instances.length = p
  6832. }
  6833. }
  6834. var g = m;
  6835. if (d && !m) {
  6836. for (e = 0, n = f.instances.length; e < n; e++) {
  6837. o = f.instances[e];
  6838. for (t = 0, r = this.parameters.length; t < r; t++) this.results[t] = this.parameters[t].get(e);
  6839. if (this.beh_index > -1) i = this.func.apply(o.behavior_insts[this.beh_index], this.results);
  6840. else i = this.func.apply(o, this.results); if (cr.xor(i, this.inverted)) {
  6841. m = true;
  6842. break
  6843. }
  6844. }
  6845. }
  6846. if (this.type.finish) this.type.finish(g || l);
  6847. return l ? m : f.hasObjects()
  6848. }
  6849. };
  6850. cr.condition = a;
  6851. f.prototype.postInit = function() {
  6852. var e, t;
  6853. for (e = 0, t = this.parameters.length; e < t; e++) this.parameters[e].postInit()
  6854. };
  6855. f.prototype.run_system = function() {
  6856. var e, t;
  6857. for (e = 0, t = this.parameters.length; e < t; e++) this.results[e] = this.parameters[e].get();
  6858. return this.func.apply(this.runtime.system, this.results)
  6859. };
  6860. f.prototype.run_object = function() {
  6861. var e = this.type.getCurrentSol().getObjects();
  6862. var t, n, r, i, s;
  6863. for (t = 0, r = e.length; t < r; t++) {
  6864. s = e[t];
  6865. for (n = 0, i = this.parameters.length; n < i; n++) this.results[n] = this.parameters[n].get(t);
  6866. if (this.beh_index > -1) {
  6867. var o = 0;
  6868. if (this.type.is_family) {
  6869. o = s.type.family_beh_map[this.type.family_index]
  6870. }
  6871. this.func.apply(s.behavior_insts[this.beh_index + o], this.results)
  6872. } else this.func.apply(s, this.results)
  6873. }
  6874. return false
  6875. };
  6876. cr.action = f;
  6877. var l = [];
  6878. var c = -1;
  6879. h.prototype.postInit = function() {
  6880. var e, t;
  6881. if (this.type === 11) {
  6882. this.eventvar = this.runtime.getEventVariableByName(this.varname, this.block.parent);
  6883. } else if (this.type === 13) {
  6884. for (e = 0, t = this.subparams.length; e < t; e++) this.subparams[e].postInit()
  6885. }
  6886. if (this.expression) this.expression.postInit()
  6887. };
  6888. h.prototype.pushTempValue = function() {
  6889. c++;
  6890. if (l.length === c) l.push(new cr.expvalue);
  6891. return l[c]
  6892. };
  6893. h.prototype.popTempValue = function() {
  6894. c--
  6895. };
  6896. h.prototype.get_exp = function(e) {
  6897. this.solindex = e || 0;
  6898. var t = this.pushTempValue();
  6899. this.expression.get(t);
  6900. this.popTempValue();
  6901. return t.data
  6902. };
  6903. h.prototype.get_exp_str = function(e) {
  6904. this.solindex = e || 0;
  6905. var t = this.pushTempValue();
  6906. this.expression.get(t);
  6907. this.popTempValue();
  6908. if (cr.is_string(t.data)) return t.data;
  6909. else return ""
  6910. };
  6911. h.prototype.get_object = function() {
  6912. return this.object
  6913. };
  6914. h.prototype.get_combosel = function() {
  6915. return this.combosel
  6916. };
  6917. h.prototype.get_layer = function(e) {
  6918. this.solindex = e || 0;
  6919. var t = this.pushTempValue();
  6920. this.expression.get(t);
  6921. this.popTempValue();
  6922. if (t.is_number()) return this.runtime.getLayerByNumber(t.data);
  6923. else return this.runtime.getLayerByName(t.data)
  6924. };
  6925. h.prototype.get_layout = function() {
  6926. return this.layout
  6927. };
  6928. h.prototype.get_key = function() {
  6929. return this.key
  6930. };
  6931. h.prototype.get_instvar = function() {
  6932. return this.index
  6933. };
  6934. h.prototype.get_familyvar = function(e) {
  6935. var t = this.owner.type;
  6936. var n = null;
  6937. var r = t.getCurrentSol();
  6938. var i = r.getObjects();
  6939. if (i.length) n = i[e % i.length].type;
  6940. else {
  6941. n = r.else_instances[e % r.else_instances.length].type
  6942. }
  6943. return this.index + n.family_var_map[t.family_index]
  6944. };
  6945. h.prototype.get_eventvar = function() {
  6946. return this.eventvar
  6947. };
  6948. h.prototype.get_audiofile = function() {
  6949. return this.fileinfo
  6950. };
  6951. h.prototype.get_variadic = function() {
  6952. var e, t;
  6953. for (e = 0, t = this.subparams.length; e < t; e++) {
  6954. this.variadicret[e] = this.subparams[e].get()
  6955. }
  6956. return this.variadicret
  6957. };
  6958. cr.parameter = h;
  6959. p.prototype.postInit = function() {
  6960. this.solModifiers = r(this.solModifiers)
  6961. };
  6962. p.prototype.setValue = function(e) {
  6963. var t = this.runtime.getCurrentLocalVarStack();
  6964. if (!this.parent || this.is_static || !t) this.data = e;
  6965. else {
  6966. if (this.localIndex >= t.length) t.length = this.localIndex + 1;
  6967. t[this.localIndex] = e
  6968. }
  6969. };
  6970. p.prototype.getValue = function() {
  6971. var e = this.runtime.getCurrentLocalVarStack();
  6972. if (!this.parent || this.is_static || !e || this.is_constant) return this.data;
  6973. else {
  6974. if (this.localIndex >= e.length) {
  6975. return this.initial
  6976. }
  6977. if (typeof e[this.localIndex] === "undefined") {
  6978. return this.initial
  6979. }
  6980. return e[this.localIndex]
  6981. }
  6982. };
  6983. p.prototype.run = function() {
  6984. if (this.parent && !this.is_static && !this.is_constant) this.setValue(this.initial)
  6985. };
  6986. cr.eventvariable = p;
  6987. d.prototype.toString = function() {
  6988. return "include:" + this.include_sheet.toString()
  6989. };
  6990. d.prototype.postInit = function() {
  6991. this.include_sheet = this.runtime.eventsheets[this.include_sheet_name];
  6992. this.sheet.includes.add(this);
  6993. this.solModifiers = r(this.solModifiers)
  6994. };
  6995. d.prototype.run = function() {
  6996. if (this.parent) this.runtime.pushCleanSol(this.runtime.types_by_index);
  6997. if (!this.include_sheet.hasRun) this.include_sheet.run(true);
  6998. if (this.parent) this.runtime.popSol(this.runtime.types_by_index)
  6999. };
  7000. d.prototype.isActive = function() {
  7001. var e = this.parent;
  7002. while (e) {
  7003. if (e.group) {
  7004. if (!this.runtime.activeGroups[e.group_name.toLowerCase()]) return false
  7005. }
  7006. e = e.parent
  7007. }
  7008. return true
  7009. };
  7010. cr.eventinclude = d;
  7011. v.prototype.reset = function(e) {
  7012. this.current_event = e;
  7013. this.cndindex = 0;
  7014. this.actindex = 0;
  7015. this.temp_parents_arr.length = 0;
  7016. this.last_event_true = false;
  7017. this.else_branch_ran = false;
  7018. this.any_true_state = false
  7019. };
  7020. v.prototype.isModifierAfterCnds = function() {
  7021. if (this.current_event.solWriterAfterCnds) return true;
  7022. if (this.cndindex < this.current_event.conditions.length - 1) return !!this.current_event.solModifiers.length;
  7023. return false
  7024. };
  7025. cr.eventStackFrame = v
  7026. })();
  7027. (function() {
  7028. function e(e, t) {
  7029. this.owner = e;
  7030. this.runtime = e.runtime;
  7031. this.type = t[0];
  7032. 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];
  7033. var n = null;
  7034. this.value = null;
  7035. this.first = null;
  7036. this.second = null;
  7037. this.third = null;
  7038. this.func = null;
  7039. this.results = null;
  7040. this.parameters = null;
  7041. this.object_type = null;
  7042. this.beh_index = -1;
  7043. this.instance_expr = null;
  7044. this.varindex = -1;
  7045. this.behavior_type = null;
  7046. this.varname = null;
  7047. this.eventvar = null;
  7048. this.return_string = false;
  7049. switch (this.type) {
  7050. case 0:
  7051. case 1:
  7052. case 2:
  7053. this.value = t[1];
  7054. break;
  7055. case 3:
  7056. this.first = new cr.expNode(e, t[1]);
  7057. break;
  7058. case 18:
  7059. this.first = new cr.expNode(e, t[1]);
  7060. this.second = new cr.expNode(e, t[2]);
  7061. this.third = new cr.expNode(e, t[3]);
  7062. break;
  7063. case 19:
  7064. this.func = t[1];
  7065. this.results = [];
  7066. this.parameters = [];
  7067. if (t.length === 3) {
  7068. n = t[2];
  7069. this.results.length = n.length + 1
  7070. } else this.results.length = 1;
  7071. break;
  7072. case 20:
  7073. this.object_type = this.runtime.types_by_index[t[1]];
  7074. this.beh_index = -1;
  7075. this.func = t[2];
  7076. this.return_string = t[3];
  7077. if (t[4]) this.instance_expr = new cr.expNode(e, t[4]);
  7078. else this.instance_expr = null;
  7079. this.results = [];
  7080. this.parameters = [];
  7081. if (t.length === 6) {
  7082. n = t[5];
  7083. this.results.length = n.length + 1
  7084. } else this.results.length = 1;
  7085. break;
  7086. case 21:
  7087. this.object_type = this.runtime.types_by_index[t[1]];
  7088. this.return_string = t[2];
  7089. if (t[3]) this.instance_expr = new cr.expNode(e, t[3]);
  7090. else this.instance_expr = null;
  7091. this.varindex = t[4];
  7092. break;
  7093. case 22:
  7094. this.object_type = this.runtime.types_by_index[t[1]];
  7095. this.behavior_type = this.object_type.getBehaviorByName(t[2]);
  7096. this.beh_index = this.object_type.getBehaviorIndexByName(t[2]);
  7097. this.func = t[3];
  7098. this.return_string = t[4];
  7099. if (t[5]) this.instance_expr = new cr.expNode(e, t[5]);
  7100. else this.instance_expr = null;
  7101. this.results = [];
  7102. this.parameters = [];
  7103. if (t.length === 7) {
  7104. n = t[6];
  7105. this.results.length = n.length + 1
  7106. } else this.results.length = 1;
  7107. break;
  7108. case 23:
  7109. this.varname = t[1];
  7110. this.eventvar = null;
  7111. break
  7112. }
  7113. if (this.type >= 4 && this.type <= 17) {
  7114. this.first = new cr.expNode(e, t[1]);
  7115. this.second = new cr.expNode(e, t[2])
  7116. }
  7117. if (n) {
  7118. var r, i;
  7119. for (r = 0, i = n.length; r < i; r++) this.parameters.push(new cr.expNode(e, n[r]))
  7120. }
  7121. cr.seal(this)
  7122. }
  7123. function t(e, t) {
  7124. this.type = e || cr.exptype.Integer;
  7125. this.data = t || 0;
  7126. this.object_class = null;
  7127. if (this.type == cr.exptype.Integer) this.data = Math.floor(this.data);
  7128. cr.seal(this)
  7129. }
  7130. e.prototype.postInit = function() {
  7131. if (this.type === 23) {
  7132. this.eventvar = this.owner.runtime.getEventVariableByName(this.varname, this.owner.block.parent);
  7133. }
  7134. if (this.first) this.first.postInit();
  7135. if (this.second) this.second.postInit();
  7136. if (this.third) this.third.postInit();
  7137. if (this.instance_expr) this.instance_expr.postInit();
  7138. if (this.parameters) {
  7139. var e, t;
  7140. for (e = 0, t = this.parameters.length; e < t; e++) this.parameters[e].postInit()
  7141. }
  7142. };
  7143. e.prototype.eval_system_exp = function(e) {
  7144. this.results[0] = e;
  7145. var t = this.owner.pushTempValue();
  7146. var n, r;
  7147. for (n = 0, r = this.parameters.length; n < r; n++) {
  7148. this.parameters[n].get(t);
  7149. this.results[n + 1] = t.data
  7150. }
  7151. this.owner.popTempValue();
  7152. this.func.apply(this.runtime.system, this.results)
  7153. };
  7154. e.prototype.eval_object_behavior_exp = function(e) {
  7155. var t = this.object_type.getCurrentSol();
  7156. var n = t.getObjects();
  7157. if (!n.length) {
  7158. if (t.else_instances.length) n = t.else_instances;
  7159. else {
  7160. if (this.return_string) e.set_string("");
  7161. else e.set_int(0);
  7162. return
  7163. }
  7164. }
  7165. this.results[0] = e;
  7166. e.object_class = this.object_type;
  7167. var r = this.owner.pushTempValue();
  7168. var i, s;
  7169. for (i = 0, s = this.parameters.length; i < s; i++) {
  7170. this.parameters[i].get(r);
  7171. this.results[i + 1] = r.data
  7172. }
  7173. var o = this.owner.solindex;
  7174. if (this.instance_expr) {
  7175. this.instance_expr.get(r);
  7176. if (r.is_number()) {
  7177. o = r.data;
  7178. n = this.object_type.instances
  7179. }
  7180. }
  7181. this.owner.popTempValue();
  7182. o %= n.length;
  7183. if (o < 0) o += n.length;
  7184. var u;
  7185. var a = n[o];
  7186. if (this.beh_index > -1) {
  7187. var f = 0;
  7188. if (this.object_type.is_family) {
  7189. f = a.type.family_beh_map[this.object_type.family_index]
  7190. }
  7191. u = this.func.apply(a.behavior_insts[this.beh_index + f], this.results)
  7192. } else u = this.func.apply(a, this.results);
  7193. };
  7194. e.prototype.eval_instvar_exp = function(e) {
  7195. var t = this.object_type.getCurrentSol();
  7196. var n = t.getObjects();
  7197. if (!n.length) {
  7198. if (t.else_instances.length) n = t.else_instances;
  7199. else {
  7200. if (this.return_string) e.set_string("");
  7201. else e.set_int(0);
  7202. return
  7203. }
  7204. }
  7205. var r = this.owner.solindex;
  7206. if (this.instance_expr) {
  7207. var i = this.owner.pushTempValue();
  7208. this.instance_expr.get(i);
  7209. if (i.is_number()) {
  7210. r = i.data;
  7211. var s = this.object_type.instances;
  7212. r %= s.length;
  7213. if (r < 0) r += s.length;
  7214. var o = s[r].instance_vars[this.varindex];
  7215. if (cr.is_string(o)) e.set_string(o);
  7216. else e.set_float(o);
  7217. this.owner.popTempValue();
  7218. return
  7219. }
  7220. this.owner.popTempValue()
  7221. }
  7222. r %= n.length;
  7223. if (r < 0) r += n.length;
  7224. var u = n[r];
  7225. var a = 0;
  7226. if (this.object_type.is_family) {
  7227. a = u.type.family_var_map[this.object_type.family_index]
  7228. }
  7229. var o = u.instance_vars[this.varindex + a];
  7230. if (cr.is_string(o)) e.set_string(o);
  7231. else e.set_float(o)
  7232. };
  7233. e.prototype.eval_int = function(e) {
  7234. e.type = cr.exptype.Integer;
  7235. e.data = this.value
  7236. };
  7237. e.prototype.eval_float = function(e) {
  7238. e.type = cr.exptype.Float;
  7239. e.data = this.value
  7240. };
  7241. e.prototype.eval_string = function(e) {
  7242. e.type = cr.exptype.String;
  7243. e.data = this.value
  7244. };
  7245. e.prototype.eval_unaryminus = function(e) {
  7246. this.first.get(e);
  7247. if (e.is_number()) e.data = -e.data
  7248. };
  7249. e.prototype.eval_add = function(e) {
  7250. this.first.get(e);
  7251. var t = this.owner.pushTempValue();
  7252. this.second.get(t);
  7253. if (e.is_number() && t.is_number()) {
  7254. e.data += t.data;
  7255. if (t.is_float()) e.make_float()
  7256. }
  7257. this.owner.popTempValue()
  7258. };
  7259. e.prototype.eval_subtract = function(e) {
  7260. this.first.get(e);
  7261. var t = this.owner.pushTempValue();
  7262. this.second.get(t);
  7263. if (e.is_number() && t.is_number()) {
  7264. e.data -= t.data;
  7265. if (t.is_float()) e.make_float()
  7266. }
  7267. this.owner.popTempValue()
  7268. };
  7269. e.prototype.eval_multiply = function(e) {
  7270. this.first.get(e);
  7271. var t = this.owner.pushTempValue();
  7272. this.second.get(t);
  7273. if (e.is_number() && t.is_number()) {
  7274. e.data *= t.data;
  7275. if (t.is_float()) e.make_float()
  7276. }
  7277. this.owner.popTempValue()
  7278. };
  7279. e.prototype.eval_divide = function(e) {
  7280. this.first.get(e);
  7281. var t = this.owner.pushTempValue();
  7282. this.second.get(t);
  7283. if (e.is_number() && t.is_number()) {
  7284. e.data /= t.data;
  7285. e.make_float()
  7286. }
  7287. this.owner.popTempValue()
  7288. };
  7289. e.prototype.eval_mod = function(e) {
  7290. this.first.get(e);
  7291. var t = this.owner.pushTempValue();
  7292. this.second.get(t);
  7293. if (e.is_number() && t.is_number()) {
  7294. e.data %= t.data;
  7295. if (t.is_float()) e.make_float()
  7296. }
  7297. this.owner.popTempValue()
  7298. };
  7299. e.prototype.eval_power = function(e) {
  7300. this.first.get(e);
  7301. var t = this.owner.pushTempValue();
  7302. this.second.get(t);
  7303. if (e.is_number() && t.is_number()) {
  7304. e.data = Math.pow(e.data, t.data);
  7305. if (t.is_float()) e.make_float()
  7306. }
  7307. this.owner.popTempValue()
  7308. };
  7309. e.prototype.eval_and = function(e) {
  7310. this.first.get(e);
  7311. var t = this.owner.pushTempValue();
  7312. this.second.get(t);
  7313. if (e.is_number()) {
  7314. if (t.is_string()) {
  7315. e.set_string(e.data.toString() + t.data)
  7316. } else {
  7317. if (e.data && t.data) e.set_int(1);
  7318. else e.set_int(0)
  7319. }
  7320. } else if (e.is_string()) {
  7321. if (t.is_string()) e.data += t.data;
  7322. else {
  7323. e.data += (Math.round(t.data * 1e10) / 1e10).toString()
  7324. }
  7325. }
  7326. this.owner.popTempValue()
  7327. };
  7328. e.prototype.eval_or = function(e) {
  7329. this.first.get(e);
  7330. var t = this.owner.pushTempValue();
  7331. this.second.get(t);
  7332. if (e.is_number() && t.is_number()) {
  7333. if (e.data || t.data) e.set_int(1);
  7334. else e.set_int(0)
  7335. }
  7336. this.owner.popTempValue()
  7337. };
  7338. e.prototype.eval_conditional = function(e) {
  7339. this.first.get(e);
  7340. if (e.data) this.second.get(e);
  7341. else this.third.get(e)
  7342. };
  7343. e.prototype.eval_equal = function(e) {
  7344. this.first.get(e);
  7345. var t = this.owner.pushTempValue();
  7346. this.second.get(t);
  7347. e.set_int(e.data === t.data ? 1 : 0);
  7348. this.owner.popTempValue()
  7349. };
  7350. e.prototype.eval_notequal = function(e) {
  7351. this.first.get(e);
  7352. var t = this.owner.pushTempValue();
  7353. this.second.get(t);
  7354. e.set_int(e.data !== t.data ? 1 : 0);
  7355. this.owner.popTempValue()
  7356. };
  7357. e.prototype.eval_less = function(e) {
  7358. this.first.get(e);
  7359. var t = this.owner.pushTempValue();
  7360. this.second.get(t);
  7361. e.set_int(e.data < t.data ? 1 : 0);
  7362. this.owner.popTempValue()
  7363. };
  7364. e.prototype.eval_lessequal = 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_greater = 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_greaterequal = 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_eventvar_exp = function(e) {
  7386. var t = this.eventvar.getValue();
  7387. if (cr.is_number(t)) e.set_float(t);
  7388. else e.set_string(t)
  7389. };
  7390. cr.expNode = e;
  7391. t.prototype.is_int = function() {
  7392. return this.type === cr.exptype.Integer
  7393. };
  7394. t.prototype.is_float = function() {
  7395. return this.type === cr.exptype.Float
  7396. };
  7397. t.prototype.is_number = function() {
  7398. return this.type === cr.exptype.Integer || this.type === cr.exptype.Float
  7399. };
  7400. t.prototype.is_string = function() {
  7401. return this.type === cr.exptype.String
  7402. };
  7403. t.prototype.make_int = function() {
  7404. if (!this.is_int()) {
  7405. if (this.is_float()) this.data = Math.floor(this.data);
  7406. else if (this.is_string()) this.data = parseInt(this.data, 10);
  7407. this.type = cr.exptype.Integer
  7408. }
  7409. };
  7410. t.prototype.make_float = function() {
  7411. if (!this.is_float()) {
  7412. if (this.is_string()) this.data = parseFloat(this.data);
  7413. this.type = cr.exptype.Float
  7414. }
  7415. };
  7416. t.prototype.make_string = function() {
  7417. if (!this.is_string()) {
  7418. this.data = this.data.toString();
  7419. this.type = cr.exptype.String
  7420. }
  7421. };
  7422. t.prototype.set_int = function(e) {
  7423. this.type = cr.exptype.Integer;
  7424. this.data = Math.floor(e)
  7425. };
  7426. t.prototype.set_float = function(e) {
  7427. this.type = cr.exptype.Float;
  7428. this.data = e
  7429. };
  7430. t.prototype.set_string = function(e) {
  7431. this.type = cr.exptype.String;
  7432. this.data = e
  7433. };
  7434. t.prototype.set_any = function(e) {
  7435. if (cr.is_number(e)) {
  7436. this.type = cr.exptype.Float;
  7437. this.data = e
  7438. } else if (cr.is_string(e)) {
  7439. this.type = cr.exptype.String;
  7440. this.data = e.toString()
  7441. } else {
  7442. this.type = cr.exptype.Integer;
  7443. this.data = 0
  7444. }
  7445. };
  7446. cr.expvalue = t;
  7447. cr.exptype = {
  7448. Integer: 0,
  7449. Float: 1,
  7450. String: 2
  7451. }
  7452. })();
  7453. cr.system_object = function(e) {
  7454. this.runtime = e;
  7455. this.waits = []
  7456. };
  7457. cr.system_object.prototype.saveToJSON = function() {
  7458. var e = {};
  7459. var t, n, r, i, s, o, u, a;
  7460. e["waits"] = [];
  7461. var f = e["waits"];
  7462. var l;
  7463. for (t = 0, n = this.waits.length; t < n; t++) {
  7464. o = this.waits[t];
  7465. l = {
  7466. t: o.time,
  7467. ev: o.ev.sid,
  7468. sm: [],
  7469. sols: {}
  7470. };
  7471. if (o.ev.actions[o.actindex]) l["act"] = o.ev.actions[o.actindex].sid;
  7472. for (r = 0, i = o.solModifiers.length; r < i; r++) l["sm"].push(o.solModifiers[r].sid);
  7473. for (s in o.sols) {
  7474. if (o.sols.hasOwnProperty(s)) {
  7475. u = this.runtime.types_by_index[parseInt(s, 10)];
  7476. a = {
  7477. sa: o.sols[s].sa,
  7478. insts: []
  7479. };
  7480. for (r = 0, i = o.sols[s].insts.length; r < i; r++) a["insts"].push(o.sols[s].insts[r].uid);
  7481. l["sols"][u.sid.toString()] = a
  7482. }
  7483. }
  7484. f.push(l)
  7485. }
  7486. return e
  7487. };
  7488. cr.system_object.prototype.loadFromJSON = function(e) {
  7489. var t = e["waits"];
  7490. var n, r, i, s, o, u, a, f, l, c, h, p, d;
  7491. this.waits.length = 0;
  7492. for (n = 0, r = t.length; n < r; n++) {
  7493. u = t[n];
  7494. f = this.runtime.blocksBySid[u["ev"].toString()];
  7495. if (!f) continue;
  7496. l = -1;
  7497. for (i = 0, s = f.actions.length; i < s; i++) {
  7498. if (f.actions[i].sid === u["act"]) {
  7499. l = i;
  7500. break
  7501. }
  7502. }
  7503. if (l === -1) continue;
  7504. a = {};
  7505. a.sols = {};
  7506. a.solModifiers = [];
  7507. a.deleteme = false;
  7508. a.time = u["t"];
  7509. a.ev = f;
  7510. a.actindex = l;
  7511. for (i = 0, s = u["sm"].length; i < s; i++) {
  7512. c = this.runtime.getObjectTypeBySid(u["sm"][i]);
  7513. if (c) a.solModifiers.push(c)
  7514. }
  7515. for (o in u["sols"]) {
  7516. if (u["sols"].hasOwnProperty(o)) {
  7517. c = this.runtime.getObjectTypeBySid(parseInt(o, 10));
  7518. if (!c) continue;
  7519. h = u["sols"][o];
  7520. p = {
  7521. sa: h["sa"],
  7522. insts: []
  7523. };
  7524. for (i = 0, s = h["insts"].length; i < s; i++) {
  7525. d = this.runtime.getObjectByUID(h["insts"][i]);
  7526. if (d) p.insts.push(d)
  7527. }
  7528. a.sols[c.index.toString()] = p
  7529. }
  7530. }
  7531. this.waits.push(a)
  7532. }
  7533. };
  7534. (function() {
  7535. function t() {}
  7536. function i(e, t) {
  7537. var n = e.extra.c2_foreachordered_val;
  7538. var r = t.extra.c2_foreachordered_val;
  7539. if (cr.is_number(n) && cr.is_number(r)) return n - r;
  7540. else {
  7541. n = "" + n;
  7542. r = "" + r;
  7543. if (n < r) return -1;
  7544. else if (n > r) return 1;
  7545. else return 0
  7546. }
  7547. }
  7548. function a(e, t) {
  7549. if (!s || e !== o || t !== u) {
  7550. s = new RegExp(e, t);
  7551. o = e;
  7552. u = t
  7553. }
  7554. s.lastIndex = 0;
  7555. return s
  7556. }
  7557. function l() {}
  7558. function h() {
  7559. var e;
  7560. if (c.length) e = c.pop();
  7561. else {
  7562. e = {};
  7563. e.sols = {};
  7564. e.solModifiers = []
  7565. }
  7566. e.deleteme = false;
  7567. return e
  7568. }
  7569. function p(e) {
  7570. cr.wipe(e.sols);
  7571. e.solModifiers.length = 0;
  7572. c.push(e)
  7573. }
  7574. function v() {
  7575. var e;
  7576. if (d.length) e = d.pop();
  7577. else {
  7578. e = {};
  7579. e.insts = []
  7580. }
  7581. e.sa = false;
  7582. return e
  7583. }
  7584. function m(e) {
  7585. e.insts.length = 0;
  7586. d.push(e)
  7587. }
  7588. function g() {}
  7589. function S(e, t, n) {
  7590. if (e === b && t === w && n === E) return;
  7591. var r = a(t, n);
  7592. y = e.match(r);
  7593. b = e;
  7594. w = t;
  7595. E = n
  7596. }
  7597. var e = cr.system_object.prototype;
  7598. t.prototype.EveryTick = function() {
  7599. return true
  7600. };
  7601. t.prototype.OnLayoutStart = function() {
  7602. return true
  7603. };
  7604. t.prototype.OnLayoutEnd = function() {
  7605. return true
  7606. };
  7607. t.prototype.Compare = function(e, t, n) {
  7608. return cr.do_cmp(e, t, n)
  7609. };
  7610. t.prototype.CompareTime = function(e, t) {
  7611. var n = this.runtime.kahanTime.sum;
  7612. if (e === 0) {
  7613. var r = this.runtime.getCurrentCondition();
  7614. if (!r.extra.CompareTime_executed) {
  7615. if (n >= t) {
  7616. r.extra.CompareTime_executed = true;
  7617. return true
  7618. }
  7619. }
  7620. return false
  7621. }
  7622. return cr.do_cmp(n, e, t)
  7623. };
  7624. t.prototype.LayerVisible = function(e) {
  7625. if (!e) return false;
  7626. else return e.visible
  7627. };
  7628. t.prototype.LayerCmpOpacity = function(e, t, n) {
  7629. if (!e) return false;
  7630. return cr.do_cmp(e.opacity * 100, t, n)
  7631. };
  7632. t.prototype.Repeat = function(e) {
  7633. var t = this.runtime.getCurrentEventStack();
  7634. var n = t.current_event;
  7635. var r = t.isModifierAfterCnds();
  7636. var i = this.runtime.pushLoopStack();
  7637. var s;
  7638. if (r) {
  7639. for (s = 0; s < e && !i.stopped; s++) {
  7640. this.runtime.pushCopySol(n.solModifiers);
  7641. i.index = s;
  7642. n.retrigger();
  7643. this.runtime.popSol(n.solModifiers)
  7644. }
  7645. } else {
  7646. for (s = 0; s < e && !i.stopped; s++) {
  7647. i.index = s;
  7648. n.retrigger()
  7649. }
  7650. }
  7651. this.runtime.popLoopStack();
  7652. return false
  7653. };
  7654. t.prototype.While = function(e) {
  7655. var t = this.runtime.getCurrentEventStack();
  7656. var n = t.current_event;
  7657. var r = t.isModifierAfterCnds();
  7658. var i = this.runtime.pushLoopStack();
  7659. var s;
  7660. if (r) {
  7661. for (s = 0; !i.stopped; s++) {
  7662. this.runtime.pushCopySol(n.solModifiers);
  7663. i.index = s;
  7664. if (!n.retrigger()) i.stopped = true;
  7665. this.runtime.popSol(n.solModifiers)
  7666. }
  7667. } else {
  7668. for (s = 0; !i.stopped; s++) {
  7669. i.index = s;
  7670. if (!n.retrigger()) i.stopped = true
  7671. }
  7672. }
  7673. this.runtime.popLoopStack();
  7674. return false
  7675. };
  7676. t.prototype.For = function(e, t, n) {
  7677. var r = this.runtime.getCurrentEventStack();
  7678. var i = r.current_event;
  7679. var s = r.isModifierAfterCnds();
  7680. var o = this.runtime.pushLoopStack(e);
  7681. var u;
  7682. if (n < t) {
  7683. if (s) {
  7684. for (u = t; u >= n && !o.stopped; --u) {
  7685. this.runtime.pushCopySol(i.solModifiers);
  7686. o.index = u;
  7687. i.retrigger();
  7688. this.runtime.popSol(i.solModifiers)
  7689. }
  7690. } else {
  7691. for (u = t; u >= n && !o.stopped; --u) {
  7692. o.index = u;
  7693. i.retrigger()
  7694. }
  7695. }
  7696. } else {
  7697. if (s) {
  7698. for (u = t; u <= n && !o.stopped; ++u) {
  7699. this.runtime.pushCopySol(i.solModifiers);
  7700. o.index = u;
  7701. i.retrigger();
  7702. this.runtime.popSol(i.solModifiers)
  7703. }
  7704. } else {
  7705. for (u = t; u <= n && !o.stopped; ++u) {
  7706. o.index = u;
  7707. i.retrigger()
  7708. }
  7709. }
  7710. }
  7711. this.runtime.popLoopStack();
  7712. return false
  7713. };
  7714. var n = [];
  7715. var r = -1;
  7716. t.prototype.ForEach = function(e) {
  7717. var t = e.getCurrentSol();
  7718. r++;
  7719. if (n.length === r) n.push([]);
  7720. var i = n[r];
  7721. cr.shallowAssignArray(i, t.getObjects());
  7722. var s = this.runtime.getCurrentEventStack();
  7723. var o = s.current_event;
  7724. var u = s.isModifierAfterCnds();
  7725. var a = this.runtime.pushLoopStack();
  7726. var f, l, c, h, p, d, v;
  7727. var m = e.is_contained;
  7728. if (u) {
  7729. for (f = 0, l = i.length; f < l && !a.stopped; f++) {
  7730. this.runtime.pushCopySol(o.solModifiers);
  7731. p = i[f];
  7732. t = e.getCurrentSol();
  7733. t.select_all = false;
  7734. t.instances.length = 1;
  7735. t.instances[0] = p;
  7736. if (m) {
  7737. for (c = 0, h = p.siblings.length; c < h; c++) {
  7738. d = p.siblings[c];
  7739. v = d.type.getCurrentSol();
  7740. v.select_all = false;
  7741. v.instances.length = 1;
  7742. v.instances[0] = d
  7743. }
  7744. }
  7745. a.index = f;
  7746. o.retrigger();
  7747. this.runtime.popSol(o.solModifiers)
  7748. }
  7749. } else {
  7750. t.select_all = false;
  7751. t.instances.length = 1;
  7752. for (f = 0, l = i.length; f < l && !a.stopped; f++) {
  7753. p = i[f];
  7754. t.instances[0] = p;
  7755. if (m) {
  7756. for (c = 0, h = p.siblings.length; c < h; c++) {
  7757. d = p.siblings[c];
  7758. v = d.type.getCurrentSol();
  7759. v.select_all = false;
  7760. v.instances.length = 1;
  7761. v.instances[0] = d
  7762. }
  7763. }
  7764. a.index = f;
  7765. o.retrigger()
  7766. }
  7767. }
  7768. i.length = 0;
  7769. this.runtime.popLoopStack();
  7770. r--;
  7771. return false
  7772. };
  7773. t.prototype.ForEachOrdered = function(e, t, s) {
  7774. var o = e.getCurrentSol();
  7775. r++;
  7776. if (n.length === r) n.push([]);
  7777. var u = n[r];
  7778. cr.shallowAssignArray(u, o.getObjects());
  7779. var a = this.runtime.getCurrentEventStack();
  7780. var f = a.current_event;
  7781. var l = this.runtime.getCurrentCondition();
  7782. var c = a.isModifierAfterCnds();
  7783. var h = this.runtime.pushLoopStack();
  7784. var p, d, v, m, g, y, b;
  7785. for (p = 0, d = u.length; p < d; p++) {
  7786. u[p].extra.c2_foreachordered_val = l.parameters[1].get(p)
  7787. }
  7788. u.sort(i);
  7789. if (s === 1) u.reverse();
  7790. var w = e.is_contained;
  7791. if (c) {
  7792. for (p = 0, d = u.length; p < d && !h.stopped; p++) {
  7793. this.runtime.pushCopySol(f.solModifiers);
  7794. g = u[p];
  7795. o = e.getCurrentSol();
  7796. o.select_all = false;
  7797. o.instances.length = 1;
  7798. o.instances[0] = g;
  7799. if (w) {
  7800. for (v = 0, m = g.siblings.length; v < m; v++) {
  7801. y = g.siblings[v];
  7802. b = y.type.getCurrentSol();
  7803. b.select_all = false;
  7804. b.instances.length = 1;
  7805. b.instances[0] = y
  7806. }
  7807. }
  7808. h.index = p;
  7809. f.retrigger();
  7810. this.runtime.popSol(f.solModifiers)
  7811. }
  7812. } else {
  7813. o.select_all = false;
  7814. o.instances.length = 1;
  7815. for (p = 0, d = u.length; p < d && !h.stopped; p++) {
  7816. g = u[p];
  7817. o.instances[0] = g;
  7818. if (w) {
  7819. for (v = 0, m = g.siblings.length; v < m; v++) {
  7820. y = g.siblings[v];
  7821. b = y.type.getCurrentSol();
  7822. b.select_all = false;
  7823. b.instances.length = 1;
  7824. b.instances[0] = y
  7825. }
  7826. }
  7827. h.index = p;
  7828. f.retrigger()
  7829. }
  7830. }
  7831. u.length = 0;
  7832. this.runtime.popLoopStack();
  7833. r--;
  7834. return false
  7835. };
  7836. t.prototype.PickByComparison = function(e, t, i, s) {
  7837. var o, u, a, f;
  7838. if (!e) return;
  7839. r++;
  7840. if (n.length === r) n.push([]);
  7841. var l = n[r];
  7842. var c = e.getCurrentSol();
  7843. cr.shallowAssignArray(l, c.getObjects());
  7844. if (c.select_all) c.else_instances.length = 0;
  7845. var h = this.runtime.getCurrentCondition();
  7846. for (o = 0, a = 0, u = l.length; o < u; o++) {
  7847. f = l[o];
  7848. l[a] = f;
  7849. t = h.parameters[1].get(o);
  7850. s = h.parameters[3].get(o);
  7851. if (cr.do_cmp(t, i, s)) {
  7852. a++
  7853. } else {
  7854. c.else_instances.push(f)
  7855. }
  7856. }
  7857. l.length = a;
  7858. c.select_all = false;
  7859. cr.shallowAssignArray(c.instances, l);
  7860. l.length = 0;
  7861. r--;
  7862. e.applySolToContainer();
  7863. return !!c.instances.length
  7864. };
  7865. t.prototype.PickByEvaluate = function(e, t) {
  7866. var i, s, o, u;
  7867. if (!e) return;
  7868. r++;
  7869. if (n.length === r) n.push([]);
  7870. var a = n[r];
  7871. var f = e.getCurrentSol();
  7872. cr.shallowAssignArray(a, f.getObjects());
  7873. if (f.select_all) f.else_instances.length = 0;
  7874. var l = this.runtime.getCurrentCondition();
  7875. for (i = 0, o = 0, s = a.length; i < s; i++) {
  7876. u = a[i];
  7877. a[o] = u;
  7878. t = l.parameters[1].get(i);
  7879. if (t) {
  7880. o++
  7881. } else {
  7882. f.else_instances.push(u)
  7883. }
  7884. }
  7885. a.length = o;
  7886. f.select_all = false;
  7887. cr.shallowAssignArray(f.instances, a);
  7888. a.length = 0;
  7889. r--;
  7890. e.applySolToContainer();
  7891. return !!f.instances.length
  7892. };
  7893. t.prototype.TriggerOnce = function() {
  7894. var e = this.runtime.getCurrentCondition().extra;
  7895. if (typeof e.TriggerOnce_lastTick === "undefined") e.TriggerOnce_lastTick = -1;
  7896. var t = e.TriggerOnce_lastTick;
  7897. var n = this.runtime.tickcount;
  7898. e.TriggerOnce_lastTick = n;
  7899. return this.runtime.layout_first_tick || t !== n - 1
  7900. };
  7901. t.prototype.Every = function(e) {
  7902. var t = this.runtime.getCurrentCondition();
  7903. var n = t.extra.Every_lastTime || 0;
  7904. var r = this.runtime.kahanTime.sum;
  7905. if (typeof t.extra.Every_seconds === "undefined") t.extra.Every_seconds = e;
  7906. var i = t.extra.Every_seconds;
  7907. if (r >= n + i) {
  7908. t.extra.Every_lastTime = n + i;
  7909. if (r >= t.extra.Every_lastTime + i) t.extra.Every_lastTime = r;
  7910. t.extra.Every_seconds = e;
  7911. return true
  7912. } else return false
  7913. };
  7914. t.prototype.PickNth = function(e, t) {
  7915. if (!e) return false;
  7916. var n = e.getCurrentSol();
  7917. var r = n.getObjects();
  7918. t = cr.floor(t);
  7919. if (t < 0 || t >= r.length) return false;
  7920. var i = r[t];
  7921. n.pick_one(i);
  7922. e.applySolToContainer();
  7923. return true
  7924. };
  7925. t.prototype.PickRandom = function(e) {
  7926. if (!e) return false;
  7927. var t = e.getCurrentSol();
  7928. var n = t.getObjects();
  7929. var r = cr.floor(Math.random() * n.length);
  7930. if (r >= n.length) return false;
  7931. var i = n[r];
  7932. t.pick_one(i);
  7933. e.applySolToContainer();
  7934. return true
  7935. };
  7936. t.prototype.CompareVar = function(e, t, n) {
  7937. return cr.do_cmp(e.getValue(), t, n)
  7938. };
  7939. t.prototype.IsGroupActive = function(e) {
  7940. return this.runtime.activeGroups[e.toLowerCase()]
  7941. };
  7942. t.prototype.IsPreview = function() {
  7943. return typeof cr_is_preview !== "undefined"
  7944. };
  7945. t.prototype.PickAll = function(e) {
  7946. if (!e) return false;
  7947. if (!e.instances.length) return false;
  7948. var t = e.getCurrentSol();
  7949. t.select_all = true;
  7950. e.applySolToContainer();
  7951. return true
  7952. };
  7953. t.prototype.IsMobile = function() {
  7954. return this.runtime.isMobile
  7955. };
  7956. t.prototype.CompareBetween = function(e, t, n) {
  7957. return e >= t && e <= n
  7958. };
  7959. t.prototype.Else = function() {
  7960. var e = this.runtime.getCurrentEventStack();
  7961. if (e.else_branch_ran) return false;
  7962. else return !e.last_event_true
  7963. };
  7964. t.prototype.OnLoadFinished = function() {
  7965. return true
  7966. };
  7967. t.prototype.OnCanvasSnapshot = function() {
  7968. return true
  7969. };
  7970. t.prototype.EffectsSupported = function() {
  7971. return !!this.runtime.glwrap
  7972. };
  7973. t.prototype.OnSaveComplete = function() {
  7974. return true
  7975. };
  7976. t.prototype.OnLoadComplete = function() {
  7977. return true
  7978. };
  7979. t.prototype.OnLoadFailed = function() {
  7980. return true
  7981. };
  7982. t.prototype.ObjectUIDExists = function(e) {
  7983. return !!this.runtime.getObjectByUID(e)
  7984. };
  7985. t.prototype.IsOnPlatform = function(e) {
  7986. var t = this.runtime;
  7987. switch (e) {
  7988. case 0:
  7989. return !t.isDomFree && !t.isNodeWebkit && !t.isPhoneGap && !t.isWindows8App && !t.isWindowsPhone8 && !t.isBlackberry10;
  7990. case 1:
  7991. return t.isiOS;
  7992. case 2:
  7993. return t.isAndroid;
  7994. case 3:
  7995. return t.isWindows8App;
  7996. case 4:
  7997. return t.isWindowsPhone8;
  7998. case 5:
  7999. return t.isBlackberry10;
  8000. case 6:
  8001. return t.isTizen;
  8002. case 7:
  8003. return t.isNodeWebkit;
  8004. case 8:
  8005. return t.isCocoonJs;
  8006. case 9:
  8007. return t.isPhoneGap;
  8008. case 10:
  8009. return t.isArcade;
  8010. case 11:
  8011. return t.isNodeWebkit;
  8012. default:
  8013. return false
  8014. }
  8015. };
  8016. var s = null;
  8017. var o = "";
  8018. var u = "";
  8019. t.prototype.RegexTest = function(e, t, n) {
  8020. var r = a(t, n);
  8021. return r.test(e)
  8022. };
  8023. var f = [];
  8024. t.prototype.PickOverlappingPoint = function(e, t, n) {
  8025. if (!e) return false;
  8026. var r = e.getCurrentSol();
  8027. var i = r.getObjects();
  8028. var s = this.runtime.getCurrentEventStack().current_event;
  8029. var o = s.orblock;
  8030. var u = this.runtime.getCurrentCondition();
  8031. var a, l, c, h;
  8032. if (r.select_all) {
  8033. cr.shallowAssignArray(f, i);
  8034. r.else_instances.length = 0;
  8035. r.select_all = false;
  8036. r.instances.length = 0
  8037. } else {
  8038. if (o) {
  8039. cr.shallowAssignArray(f, r.else_instances);
  8040. r.else_instances.length = 0
  8041. } else {
  8042. cr.shallowAssignArray(f, i);
  8043. r.instances.length = 0
  8044. }
  8045. }
  8046. for (a = 0, l = f.length; a < l; ++a) {
  8047. c = f[a];
  8048. h = cr.xor(c.contains_pt(t, n), u.inverted);
  8049. if (h) r.instances.push(c);
  8050. else r.else_instances.push(c)
  8051. }
  8052. e.applySolToContainer();
  8053. return cr.xor(!!r.instances.length, u.inverted)
  8054. };
  8055. e.cnds = new t;
  8056. l.prototype.GoToLayout = function(e) {
  8057. if (this.runtime.isloading) return;
  8058. if (this.runtime.changelayout) return;
  8059. this.runtime.changelayout = e
  8060. };
  8061. l.prototype.CreateObject = function(e, t, n, r) {
  8062. if (!t || !e) return;
  8063. var i = this.runtime.createInstance(e, t, n, r);
  8064. if (!i) return;
  8065. this.runtime.isInOnDestroy++;
  8066. var s, o, u;
  8067. this.runtime.trigger(Object.getPrototypeOf(e.plugin).cnds.OnCreated, i);
  8068. if (i.is_contained) {
  8069. for (s = 0, o = i.siblings.length; s < o; s++) {
  8070. u = i.siblings[s];
  8071. this.runtime.trigger(Object.getPrototypeOf(u.type.plugin).cnds.OnCreated, u)
  8072. }
  8073. }
  8074. this.runtime.isInOnDestroy--;
  8075. var a = e.getCurrentSol();
  8076. a.select_all = false;
  8077. a.instances.length = 1;
  8078. a.instances[0] = i;
  8079. if (i.is_contained) {
  8080. for (s = 0, o = i.siblings.length; s < o; s++) {
  8081. u = i.siblings[s];
  8082. a = u.type.getCurrentSol();
  8083. a.select_all = false;
  8084. a.instances.length = 1;
  8085. a.instances[0] = u
  8086. }
  8087. }
  8088. };
  8089. l.prototype.SetLayerVisible = function(e, t) {
  8090. if (!e) return;
  8091. if (e.visible !== t) {
  8092. e.visible = t;
  8093. this.runtime.redraw = true
  8094. }
  8095. };
  8096. l.prototype.SetLayerOpacity = function(e, t) {
  8097. if (!e) return;
  8098. t = cr.clamp(t / 100, 0, 1);
  8099. if (e.opacity !== t) {
  8100. e.opacity = t;
  8101. this.runtime.redraw = true
  8102. }
  8103. };
  8104. l.prototype.SetLayerScaleRate = function(e, t) {
  8105. if (!e) return;
  8106. if (e.zoomRate !== t) {
  8107. e.zoomRate = t;
  8108. this.runtime.redraw = true
  8109. }
  8110. };
  8111. l.prototype.SetLayoutScale = function(e) {
  8112. if (!this.runtime.running_layout) return;
  8113. if (this.runtime.running_layout.scale !== e) {
  8114. this.runtime.running_layout.scale = e;
  8115. this.runtime.running_layout.boundScrolling();
  8116. this.runtime.redraw = true
  8117. }
  8118. };
  8119. l.prototype.ScrollX = function(e) {
  8120. this.runtime.running_layout.scrollToX(e)
  8121. };
  8122. l.prototype.ScrollY = function(e) {
  8123. this.runtime.running_layout.scrollToY(e)
  8124. };
  8125. l.prototype.Scroll = function(e, t) {
  8126. this.runtime.running_layout.scrollToX(e);
  8127. this.runtime.running_layout.scrollToY(t)
  8128. };
  8129. l.prototype.ScrollToObject = function(e) {
  8130. var t = e.getFirstPicked();
  8131. if (t) {
  8132. this.runtime.running_layout.scrollToX(t.x);
  8133. this.runtime.running_layout.scrollToY(t.y)
  8134. }
  8135. };
  8136. l.prototype.SetVar = function(e, t) {
  8137. if (e.vartype === 0) {
  8138. if (cr.is_number(t)) e.setValue(t);
  8139. else e.setValue(parseFloat(t))
  8140. } else if (e.vartype === 1) e.setValue(t.toString())
  8141. };
  8142. l.prototype.AddVar = function(e, t) {
  8143. if (e.vartype === 0) {
  8144. if (cr.is_number(t)) e.setValue(e.getValue() + t);
  8145. else e.setValue(e.getValue() + parseFloat(t))
  8146. } else if (e.vartype === 1) e.setValue(e.getValue() + t.toString())
  8147. };
  8148. l.prototype.SubVar = function(e, t) {
  8149. if (e.vartype === 0) {
  8150. if (cr.is_number(t)) e.setValue(e.getValue() - t);
  8151. else e.setValue(e.getValue() - parseFloat(t))
  8152. }
  8153. };
  8154. l.prototype.SetGroupActive = function(e, t) {
  8155. var n = this.runtime.activeGroups;
  8156. var r = e.toLowerCase();
  8157. switch (t) {
  8158. case 0:
  8159. n[r] = false;
  8160. break;
  8161. case 1:
  8162. n[r] = true;
  8163. break;
  8164. case 2:
  8165. n[r] = !n[r];
  8166. break
  8167. }
  8168. };
  8169. l.prototype.SetTimescale = function(e) {
  8170. var t = e;
  8171. if (t < 0) t = 0;
  8172. this.runtime.timescale = t
  8173. };
  8174. l.prototype.SetObjectTimescale = function(e, t) {
  8175. var n = t;
  8176. if (n < 0) n = 0;
  8177. if (!e) return;
  8178. var r = e.getCurrentSol();
  8179. var i = r.getObjects();
  8180. var s, o;
  8181. for (s = 0, o = i.length; s < o; s++) {
  8182. i[s].my_timescale = n
  8183. }
  8184. };
  8185. l.prototype.RestoreObjectTimescale = function(e) {
  8186. if (!e) return false;
  8187. var t = e.getCurrentSol();
  8188. var n = t.getObjects();
  8189. var r, i;
  8190. for (r = 0, i = n.length; r < i; r++) {
  8191. n[r].my_timescale = -1
  8192. }
  8193. };
  8194. var c = [];
  8195. var d = [];
  8196. l.prototype.Wait = function(e) {
  8197. if (e < 0) return;
  8198. var t, n, r, i, s;
  8199. var o = this.runtime.getCurrentEventStack();
  8200. var u = h();
  8201. u.time = this.runtime.kahanTime.sum + e;
  8202. u.ev = o.current_event;
  8203. u.actindex = o.actindex + 1;
  8204. for (t = 0, n = this.runtime.types_by_index.length; t < n; t++) {
  8205. i = this.runtime.types_by_index[t];
  8206. r = i.getCurrentSol();
  8207. if (r.select_all && o.current_event.solModifiers.indexOf(i) === -1) continue;
  8208. u.solModifiers.push(i);
  8209. s = v();
  8210. s.sa = r.select_all;
  8211. cr.shallowAssignArray(s.insts, r.instances);
  8212. u.sols[t.toString()] = s
  8213. }
  8214. this.waits.push(u);
  8215. return true
  8216. };
  8217. l.prototype.SetLayerScale = function(e, t) {
  8218. if (!e) return;
  8219. if (e.scale === t) return;
  8220. e.scale = t;
  8221. this.runtime.redraw = true
  8222. };
  8223. l.prototype.ResetGlobals = function() {
  8224. var e, t, n;
  8225. for (e = 0, t = this.runtime.all_global_vars.length; e < t; e++) {
  8226. n = this.runtime.all_global_vars[e];
  8227. n.data = n.initial
  8228. }
  8229. };
  8230. l.prototype.SetLayoutAngle = function(e) {
  8231. e = cr.to_radians(e);
  8232. e = cr.clamp_angle(e);
  8233. if (this.runtime.running_layout) {
  8234. if (this.runtime.running_layout.angle !== e) {
  8235. this.runtime.running_layout.angle = e;
  8236. this.runtime.redraw = true
  8237. }
  8238. }
  8239. };
  8240. l.prototype.SetLayerAngle = function(e, t) {
  8241. if (!e) return;
  8242. t = cr.to_radians(t);
  8243. t = cr.clamp_angle(t);
  8244. if (e.angle === t) return;
  8245. e.angle = t;
  8246. this.runtime.redraw = true
  8247. };
  8248. l.prototype.SetLayerParallax = function(e, t, n) {
  8249. if (!e) return;
  8250. if (e.parallaxX === t / 100 && e.parallaxY === n / 100) return;
  8251. e.parallaxX = t / 100;
  8252. e.parallaxY = n / 100;
  8253. this.runtime.redraw = true
  8254. };
  8255. l.prototype.SetLayerBackground = function(e, t) {
  8256. if (!e) return;
  8257. var n = cr.GetRValue(t);
  8258. var r = cr.GetGValue(t);
  8259. var i = cr.GetBValue(t);
  8260. if (e.background_color[0] === n && e.background_color[1] === r && e.background_color[2] === i) return;
  8261. e.background_color[0] = n;
  8262. e.background_color[1] = r;
  8263. e.background_color[2] = i;
  8264. this.runtime.redraw = true
  8265. };
  8266. l.prototype.SetLayerTransparent = function(e, t) {
  8267. if (!e) return;
  8268. if (!!t === !!e.transparent) return;
  8269. e.transparent = !!t;
  8270. this.runtime.redraw = true
  8271. };
  8272. l.prototype.StopLoop = function() {
  8273. if (this.runtime.loop_stack_index < 0) return;
  8274. this.runtime.getCurrentLoop().stopped = true
  8275. };
  8276. l.prototype.GoToLayoutByName = function(e) {
  8277. if (this.runtime.isloading) return;
  8278. if (this.runtime.changelayout) return;
  8279. var t;
  8280. for (t in this.runtime.layouts) {
  8281. if (this.runtime.layouts.hasOwnProperty(t) && cr.equals_nocase(t, e)) {
  8282. this.runtime.changelayout = this.runtime.layouts[t];
  8283. return
  8284. }
  8285. }
  8286. };
  8287. l.prototype.RestartLayout = function(e) {
  8288. if (this.runtime.isloading) return;
  8289. if (this.runtime.changelayout) return;
  8290. if (!this.runtime.running_layout) return;
  8291. this.runtime.changelayout = this.runtime.running_layout;
  8292. var t, n, r;
  8293. for (t = 0, n = this.runtime.allGroups.length; t < n; t++) {
  8294. r = this.runtime.allGroups[t];
  8295. this.runtime.activeGroups[r.group_name.toLowerCase()] = r.initially_activated
  8296. }
  8297. };
  8298. l.prototype.SnapshotCanvas = function(e, t) {
  8299. this.runtime.snapshotCanvas = [e === 0 ? "image/png" : "image/jpeg", t / 100];
  8300. this.runtime.redraw = true
  8301. };
  8302. l.prototype.SetCanvasSize = function(e, t) {
  8303. if (e <= 0 || t <= 0) return;
  8304. this.runtime["setSize"](e, t)
  8305. };
  8306. l.prototype.SetLayoutEffectEnabled = function(e, t) {
  8307. if (!this.runtime.running_layout || !this.runtime.glwrap) return;
  8308. var n = this.runtime.running_layout.getEffectByName(t);
  8309. if (!n) return;
  8310. var r = e === 1;
  8311. if (n.active == r) return;
  8312. n.active = r;
  8313. this.runtime.running_layout.updateActiveEffects();
  8314. this.runtime.redraw = true
  8315. };
  8316. l.prototype.SetLayerEffectEnabled = function(e, t, n) {
  8317. if (!e || !this.runtime.glwrap) return;
  8318. var r = e.getEffectByName(n);
  8319. if (!r) return;
  8320. var i = t === 1;
  8321. if (r.active == i) return;
  8322. r.active = i;
  8323. e.updateActiveEffects();
  8324. this.runtime.redraw = true
  8325. };
  8326. l.prototype.SetLayoutEffectParam = function(e, t, n) {
  8327. if (!this.runtime.running_layout || !this.runtime.glwrap) return;
  8328. var r = this.runtime.running_layout.getEffectByName(e);
  8329. if (!r) return;
  8330. var i = this.runtime.running_layout.effect_params[r.index];
  8331. t = Math.floor(t);
  8332. if (t < 0 || t >= i.length) return;
  8333. if (this.runtime.glwrap.getProgramParameterType(r.shaderindex, t) === 1) n /= 100;
  8334. if (i[t] === n) return;
  8335. i[t] = n;
  8336. if (r.active) this.runtime.redraw = true
  8337. };
  8338. l.prototype.SetLayerEffectParam = function(e, t, n, r) {
  8339. if (!e || !this.runtime.glwrap) return;
  8340. var i = e.getEffectByName(t);
  8341. if (!i) return;
  8342. var s = e.effect_params[i.index];
  8343. n = Math.floor(n);
  8344. if (n < 0 || n >= s.length) return;
  8345. if (this.runtime.glwrap.getProgramParameterType(i.shaderindex, n) === 1) r /= 100;
  8346. if (s[n] === r) return;
  8347. s[n] = r;
  8348. if (i.active) this.runtime.redraw = true
  8349. };
  8350. l.prototype.SaveState = function(e) {
  8351. this.runtime.saveToSlot = e
  8352. };
  8353. l.prototype.LoadState = function(e) {
  8354. this.runtime.loadFromSlot = e
  8355. };
  8356. l.prototype.LoadStateJSON = function(e) {
  8357. this.runtime.loadFromJson = e
  8358. };
  8359. e.acts = new l;
  8360. g.prototype["int"] = function(e, t) {
  8361. if (cr.is_string(t)) {
  8362. e.set_int(parseInt(t, 10));
  8363. if (isNaN(e.data)) e.data = 0
  8364. } else e.set_int(t)
  8365. };
  8366. g.prototype["float"] = function(e, t) {
  8367. if (cr.is_string(t)) {
  8368. e.set_float(parseFloat(t));
  8369. if (isNaN(e.data)) e.data = 0
  8370. } else e.set_float(t)
  8371. };
  8372. g.prototype.str = function(e, t) {
  8373. if (cr.is_string(t)) e.set_string(t);
  8374. else e.set_string(t.toString())
  8375. };
  8376. g.prototype.len = function(e, t) {
  8377. e.set_int(t.length || 0)
  8378. };
  8379. g.prototype.random = function(e, t, n) {
  8380. if (n === undefined) {
  8381. e.set_float(Math.random() * t)
  8382. } else {
  8383. e.set_float(Math.random() * (n - t) + t)
  8384. }
  8385. };
  8386. g.prototype.sqrt = function(e, t) {
  8387. e.set_float(Math.sqrt(t))
  8388. };
  8389. g.prototype.abs = function(e, t) {
  8390. e.set_float(Math.abs(t))
  8391. };
  8392. g.prototype.round = function(e, t) {
  8393. e.set_int(Math.round(t))
  8394. };
  8395. g.prototype.floor = function(e, t) {
  8396. e.set_int(Math.floor(t))
  8397. };
  8398. g.prototype.ceil = function(e, t) {
  8399. e.set_int(Math.ceil(t))
  8400. };
  8401. g.prototype.sin = function(e, t) {
  8402. e.set_float(Math.sin(cr.to_radians(t)))
  8403. };
  8404. g.prototype.cos = function(e, t) {
  8405. e.set_float(Math.cos(cr.to_radians(t)))
  8406. };
  8407. g.prototype.tan = function(e, t) {
  8408. e.set_float(Math.tan(cr.to_radians(t)))
  8409. };
  8410. g.prototype.asin = function(e, t) {
  8411. e.set_float(cr.to_degrees(Math.asin(t)))
  8412. };
  8413. g.prototype.acos = function(e, t) {
  8414. e.set_float(cr.to_degrees(Math.acos(t)))
  8415. };
  8416. g.prototype.atan = function(e, t) {
  8417. e.set_float(cr.to_degrees(Math.atan(t)))
  8418. };
  8419. g.prototype.exp = function(e, t) {
  8420. e.set_float(Math.exp(t))
  8421. };
  8422. g.prototype.ln = function(e, t) {
  8423. e.set_float(Math.log(t))
  8424. };
  8425. g.prototype.log10 = function(e, t) {
  8426. e.set_float(Math.log(t) / Math.LN10)
  8427. };
  8428. g.prototype.max = function(e) {
  8429. var t = arguments[1];
  8430. var n, r;
  8431. for (n = 2, r = arguments.length; n < r; n++) {
  8432. if (t < arguments[n]) t = arguments[n]
  8433. }
  8434. e.set_float(t)
  8435. };
  8436. g.prototype.min = function(e) {
  8437. var t = arguments[1];
  8438. var n, r;
  8439. for (n = 2, r = arguments.length; n < r; n++) {
  8440. if (t > arguments[n]) t = arguments[n]
  8441. }
  8442. e.set_float(t)
  8443. };
  8444. g.prototype.dt = function(e) {
  8445. e.set_float(this.runtime.dt)
  8446. };
  8447. g.prototype.timescale = function(e) {
  8448. e.set_float(this.runtime.timescale)
  8449. };
  8450. g.prototype.wallclocktime = function(e) {
  8451. e.set_float((Date.now() - this.runtime.start_time) / 1e3)
  8452. };
  8453. g.prototype.time = function(e) {
  8454. e.set_float(this.runtime.kahanTime.sum)
  8455. };
  8456. g.prototype.tickcount = function(e) {
  8457. e.set_int(this.runtime.tickcount)
  8458. };
  8459. g.prototype.objectcount = function(e) {
  8460. e.set_int(this.runtime.objectcount)
  8461. };
  8462. g.prototype.fps = function(e) {
  8463. e.set_int(this.runtime.fps)
  8464. };
  8465. g.prototype.loopindex = function(e, t) {
  8466. var n, r, i;
  8467. if (!this.runtime.loop_stack.length) {
  8468. e.set_int(0);
  8469. return
  8470. }
  8471. if (t) {
  8472. for (r = 0, i = this.runtime.loop_stack.length; r < i; r++) {
  8473. n = this.runtime.loop_stack[r];
  8474. if (n.name === t) {
  8475. e.set_int(n.index);
  8476. return
  8477. }
  8478. }
  8479. e.set_int(0)
  8480. } else {
  8481. n = this.runtime.getCurrentLoop();
  8482. e.set_int(n ? n.index : -1)
  8483. }
  8484. };
  8485. g.prototype.distance = function(e, t, n, r, i) {
  8486. e.set_float(cr.distanceTo(t, n, r, i))
  8487. };
  8488. g.prototype.angle = function(e, t, n, r, i) {
  8489. e.set_float(cr.to_degrees(cr.angleTo(t, n, r, i)))
  8490. };
  8491. g.prototype.scrollx = function(e) {
  8492. e.set_float(this.runtime.running_layout.scrollX)
  8493. };
  8494. g.prototype.scrolly = function(e) {
  8495. e.set_float(this.runtime.running_layout.scrollY)
  8496. };
  8497. g.prototype.newline = function(e) {
  8498. e.set_string("\n")
  8499. };
  8500. g.prototype.lerp = function(e, t, n, r) {
  8501. e.set_float(cr.lerp(t, n, r))
  8502. };
  8503. g.prototype.windowwidth = function(e) {
  8504. e.set_int(this.runtime.width)
  8505. };
  8506. g.prototype.windowheight = function(e) {
  8507. e.set_int(this.runtime.height)
  8508. };
  8509. g.prototype.uppercase = function(e, t) {
  8510. e.set_string(cr.is_string(t) ? t.toUpperCase() : "")
  8511. };
  8512. g.prototype.lowercase = function(e, t) {
  8513. e.set_string(cr.is_string(t) ? t.toLowerCase() : "")
  8514. };
  8515. g.prototype.clamp = function(e, t, n, r) {
  8516. if (t < n) e.set_float(n);
  8517. else if (t > r) e.set_float(r);
  8518. else e.set_float(t)
  8519. };
  8520. g.prototype.layerscale = function(e, t) {
  8521. var n = this.runtime.getLayer(t);
  8522. if (!n) e.set_float(0);
  8523. else e.set_float(n.scale)
  8524. };
  8525. g.prototype.layeropacity = function(e, t) {
  8526. var n = this.runtime.getLayer(t);
  8527. if (!n) e.set_float(0);
  8528. else e.set_float(n.opacity * 100)
  8529. };
  8530. g.prototype.layerscalerate = function(e, t) {
  8531. var n = this.runtime.getLayer(t);
  8532. if (!n) e.set_float(0);
  8533. else e.set_float(n.zoomRate)
  8534. };
  8535. g.prototype.layerparallaxx = function(e, t) {
  8536. var n = this.runtime.getLayer(t);
  8537. if (!n) e.set_float(0);
  8538. else e.set_float(n.parallaxX * 100)
  8539. };
  8540. g.prototype.layerparallaxy = function(e, t) {
  8541. var n = this.runtime.getLayer(t);
  8542. if (!n) e.set_float(0);
  8543. else e.set_float(n.parallaxY * 100)
  8544. };
  8545. g.prototype.layoutscale = function(e) {
  8546. if (this.runtime.running_layout) e.set_float(this.runtime.running_layout.scale);
  8547. else e.set_float(0)
  8548. };
  8549. g.prototype.layoutangle = function(e) {
  8550. e.set_float(cr.to_degrees(this.runtime.running_layout.angle))
  8551. };
  8552. g.prototype.layerangle = function(e, t) {
  8553. var n = this.runtime.getLayer(t);
  8554. if (!n) e.set_float(0);
  8555. else e.set_float(cr.to_degrees(n.angle))
  8556. };
  8557. g.prototype.layoutwidth = function(e) {
  8558. e.set_int(this.runtime.running_layout.width)
  8559. };
  8560. g.prototype.layoutheight = function(e) {
  8561. e.set_int(this.runtime.running_layout.height)
  8562. };
  8563. g.prototype.find = function(e, t, n) {
  8564. if (cr.is_string(t) && cr.is_string(n)) e.set_int(t.search(new RegExp(cr.regexp_escape(n), "i")));
  8565. else e.set_int(-1)
  8566. };
  8567. g.prototype.left = function(e, t, n) {
  8568. e.set_string(cr.is_string(t) ? t.substr(0, n) : "")
  8569. };
  8570. g.prototype.right = function(e, t, n) {
  8571. e.set_string(cr.is_string(t) ? t.substr(t.length - n) : "")
  8572. };
  8573. g.prototype.mid = function(e, t, n, r) {
  8574. e.set_string(cr.is_string(t) ? t.substr(n, r) : "")
  8575. };
  8576. g.prototype.tokenat = function(e, t, n, r) {
  8577. if (cr.is_string(t) && cr.is_string(r)) {
  8578. var i = t.split(r);
  8579. var s = cr.floor(n);
  8580. if (s < 0 || s >= i.length) e.set_string("");
  8581. else e.set_string(i[s])
  8582. } else e.set_string("")
  8583. };
  8584. g.prototype.tokencount = function(e, t, n) {
  8585. if (cr.is_string(t) && t.length) e.set_int(t.split(n).length);
  8586. else e.set_int(0)
  8587. };
  8588. g.prototype.replace = function(e, t, n, r) {
  8589. 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));
  8590. else e.set_string(cr.is_string(t) ? t : "")
  8591. };
  8592. g.prototype.trim = function(e, t) {
  8593. e.set_string(cr.is_string(t) ? t.trim() : "")
  8594. };
  8595. g.prototype.pi = function(e) {
  8596. e.set_float(cr.PI)
  8597. };
  8598. g.prototype.layoutname = function(e) {
  8599. if (this.runtime.running_layout) e.set_string(this.runtime.running_layout.name);
  8600. else e.set_string("")
  8601. };
  8602. g.prototype.renderer = function(e) {
  8603. e.set_string(this.runtime.gl ? "webgl" : "canvas2d")
  8604. };
  8605. g.prototype.anglediff = function(e, t, n) {
  8606. e.set_float(cr.to_degrees(cr.angleDiff(cr.to_radians(t), cr.to_radians(n))))
  8607. };
  8608. g.prototype.choose = function(e) {
  8609. var t = cr.floor(Math.random() * (arguments.length - 1));
  8610. e.set_any(arguments[t + 1])
  8611. };
  8612. g.prototype.rgb = function(e, t, n, r) {
  8613. e.set_int(cr.RGB(t, n, r))
  8614. };
  8615. g.prototype.projectversion = function(e) {
  8616. e.set_string(this.runtime.versionstr)
  8617. };
  8618. g.prototype.anglelerp = function(e, t, n, r) {
  8619. t = cr.to_radians(t);
  8620. n = cr.to_radians(n);
  8621. var i = cr.angleDiff(t, n);
  8622. if (cr.angleClockwise(n, t)) {
  8623. e.set_float(cr.to_clamped_degrees(t + i * r))
  8624. } else {
  8625. e.set_float(cr.to_clamped_degrees(t - i * r))
  8626. }
  8627. };
  8628. g.prototype.anglerotate = function(e, t, n, r) {
  8629. t = cr.to_radians(t);
  8630. n = cr.to_radians(n);
  8631. r = cr.to_radians(r);
  8632. e.set_float(cr.to_clamped_degrees(cr.angleRotate(t, n, r)))
  8633. };
  8634. g.prototype.zeropad = function(e, t, n) {
  8635. var r = t < 0 ? "-" : "";
  8636. if (t < 0) t = -t;
  8637. var i = n - t.toString().length;
  8638. for (var s = 0; s < i; s++) r += "0";
  8639. e.set_string(r + t.toString())
  8640. };
  8641. g.prototype.cpuutilisation = function(e) {
  8642. e.set_float(this.runtime.cpuutilisation / 1e3)
  8643. };
  8644. g.prototype.viewportleft = function(e, t) {
  8645. var n = this.runtime.getLayer(t);
  8646. e.set_float(n ? n.viewLeft : 0)
  8647. };
  8648. g.prototype.viewporttop = function(e, t) {
  8649. var n = this.runtime.getLayer(t);
  8650. e.set_float(n ? n.viewTop : 0)
  8651. };
  8652. g.prototype.viewportright = function(e, t) {
  8653. var n = this.runtime.getLayer(t);
  8654. e.set_float(n ? n.viewRight : 0)
  8655. };
  8656. g.prototype.viewportbottom = function(e, t) {
  8657. var n = this.runtime.getLayer(t);
  8658. e.set_float(n ? n.viewBottom : 0)
  8659. };
  8660. g.prototype.loadingprogress = function(e) {
  8661. e.set_float(this.runtime.loadingprogress)
  8662. };
  8663. g.prototype.unlerp = function(e, t, n, r) {
  8664. e.set_float((r - t) / (n - t))
  8665. };
  8666. g.prototype.canvassnapshot = function(e) {
  8667. e.set_string(this.runtime.snapshotData)
  8668. };
  8669. g.prototype.urlencode = function(e, t) {
  8670. e.set_string(encodeURIComponent(t))
  8671. };
  8672. g.prototype.urldecode = function(e, t) {
  8673. e.set_string(decodeURIComponent(t))
  8674. };
  8675. g.prototype.canvastolayerx = function(e, t, n, r) {
  8676. var i = this.runtime.getLayer(t);
  8677. e.set_float(i ? i.canvasToLayer(n, r, true) : 0)
  8678. };
  8679. g.prototype.canvastolayery = function(e, t, n, r) {
  8680. var i = this.runtime.getLayer(t);
  8681. e.set_float(i ? i.canvasToLayer(n, r, false) : 0)
  8682. };
  8683. g.prototype.layertocanvasx = function(e, t, n, r) {
  8684. var i = this.runtime.getLayer(t);
  8685. e.set_float(i ? i.layerToCanvas(n, r, true) : 0)
  8686. };
  8687. g.prototype.layertocanvasy = function(e, t, n, r) {
  8688. var i = this.runtime.getLayer(t);
  8689. e.set_float(i ? i.layerToCanvas(n, r, false) : 0)
  8690. };
  8691. g.prototype.savestatejson = function(e) {
  8692. e.set_string(this.runtime.lastSaveJson)
  8693. };
  8694. g.prototype.imagememoryusage = function(e) {
  8695. if (this.runtime.glwrap) e.set_float(Math.round(100 * this.runtime.glwrap.estimateVRAM() / (1024 * 1024)) / 100);
  8696. else e.set_float(0)
  8697. };
  8698. g.prototype.regexsearch = function(e, t, n, r) {
  8699. var i = a(n, r);
  8700. e.set_int(t ? t.search(i) : -1)
  8701. };
  8702. g.prototype.regexreplace = function(e, t, n, r, i) {
  8703. var s = a(n, r);
  8704. e.set_string(t ? t.replace(s, i) : "")
  8705. };
  8706. var y = [];
  8707. var b = "";
  8708. var w = "";
  8709. var E = "";
  8710. g.prototype.regexmatchcount = function(e, t, n, r) {
  8711. var i = a(n, r);
  8712. S(t, n, r);
  8713. e.set_int(y ? y.length : 0)
  8714. };
  8715. g.prototype.regexmatchat = function(e, t, n, r, i) {
  8716. i = Math.floor(i);
  8717. var s = a(n, r);
  8718. S(t, n, r);
  8719. if (!y || i < 0 || i >= y.length) e.set_string("");
  8720. else e.set_string(y[i])
  8721. };
  8722. g.prototype.infinity = function(e) {
  8723. e.set_float(Infinity)
  8724. };
  8725. e.exps = new g;
  8726. e.runWaits = function() {
  8727. var e, t, n, r, i, s, o;
  8728. var u = this.runtime.getCurrentEventStack();
  8729. for (e = 0, n = this.waits.length; e < n; e++) {
  8730. r = this.waits[e];
  8731. if (r.time > this.runtime.kahanTime.sum) continue;
  8732. u.current_event = r.ev;
  8733. u.actindex = r.actindex;
  8734. u.cndindex = 0;
  8735. for (i in r.sols) {
  8736. if (r.sols.hasOwnProperty(i)) {
  8737. s = this.runtime.types_by_index[parseInt(i, 10)].getCurrentSol();
  8738. o = r.sols[i];
  8739. s.select_all = o.sa;
  8740. cr.shallowAssignArray(s.instances, o.insts);
  8741. m(o)
  8742. }
  8743. }
  8744. r.ev.resume_actions_and_subevents();
  8745. this.runtime.clearSol(r.solModifiers);
  8746. r.deleteme = true
  8747. }
  8748. for (e = 0, t = 0, n = this.waits.length; e < n; e++) {
  8749. r = this.waits[e];
  8750. this.waits[t] = r;
  8751. if (r.deleteme) p(r);
  8752. else t++
  8753. }
  8754. this.waits.length = t
  8755. }
  8756. })();
  8757. cr.add_common_aces = function(e) {
  8758. var t = e[0].prototype;
  8759. var n = e[1];
  8760. var r = e[3];
  8761. var i = e[4];
  8762. var s = e[5];
  8763. var o = e[6];
  8764. var u = e[7];
  8765. var a = e[8];
  8766. if (!t.cnds) t.cnds = {};
  8767. if (!t.acts) t.acts = {};
  8768. if (!t.exps) t.exps = {};
  8769. var f = t.cnds;
  8770. var l = t.acts;
  8771. var c = t.exps;
  8772. if (r) {
  8773. f.CompareX = function(e, t) {
  8774. return cr.do_cmp(this.x, e, t)
  8775. };
  8776. f.CompareY = function(e, t) {
  8777. return cr.do_cmp(this.y, e, t)
  8778. };
  8779. f.IsOnScreen = function() {
  8780. var e = this.layer;
  8781. this.update_bbox();
  8782. var t = this.bbox;
  8783. return !(t.right < e.viewLeft || t.bottom < e.viewTop || t.left > e.viewRight || t.top > e.viewBottom)
  8784. };
  8785. f.IsOutsideLayout = function() {
  8786. this.update_bbox();
  8787. var e = this.bbox;
  8788. var t = this.runtime.running_layout;
  8789. return e.right < 0 || e.bottom < 0 || e.left > t.width || e.top > t.height
  8790. };
  8791. f.PickDistance = function(e, t, n) {
  8792. var r = this.getCurrentSol();
  8793. var i = r.getObjects();
  8794. if (!i.length) return false;
  8795. var s = i[0];
  8796. var o = s;
  8797. var u = cr.distanceTo(s.x, s.y, t, n);
  8798. var a, f, l;
  8799. for (a = 1, f = i.length; a < f; a++) {
  8800. s = i[a];
  8801. l = cr.distanceTo(s.x, s.y, t, n);
  8802. if (e === 0 && l < u || e === 1 && l > u) {
  8803. u = l;
  8804. o = s
  8805. }
  8806. }
  8807. r.pick_one(o);
  8808. return true
  8809. };
  8810. l.SetX = function(e) {
  8811. if (this.x !== e) {
  8812. this.x = e;
  8813. this.set_bbox_changed()
  8814. }
  8815. };
  8816. l.SetY = function(e) {
  8817. if (this.y !== e) {
  8818. this.y = e;
  8819. this.set_bbox_changed()
  8820. }
  8821. };
  8822. l.SetPos = function(e, t) {
  8823. if (this.x !== e || this.y !== t) {
  8824. this.x = e;
  8825. this.y = t;
  8826. this.set_bbox_changed()
  8827. }
  8828. };
  8829. l.SetPosToObject = function(e, t) {
  8830. var n = e.getPairedInstance(this);
  8831. if (!n) return;
  8832. var r, i;
  8833. if (n.getImagePoint) {
  8834. r = n.getImagePoint(t, true);
  8835. i = n.getImagePoint(t, false)
  8836. } else {
  8837. r = n.x;
  8838. i = n.y
  8839. } if (this.x !== r || this.y !== i) {
  8840. this.x = r;
  8841. this.y = i;
  8842. this.set_bbox_changed()
  8843. }
  8844. };
  8845. l.MoveForward = function(e) {
  8846. if (e !== 0) {
  8847. this.x += Math.cos(this.angle) * e;
  8848. this.y += Math.sin(this.angle) * e;
  8849. this.set_bbox_changed()
  8850. }
  8851. };
  8852. l.MoveAtAngle = function(e, t) {
  8853. if (t !== 0) {
  8854. this.x += Math.cos(cr.to_radians(e)) * t;
  8855. this.y += Math.sin(cr.to_radians(e)) * t;
  8856. this.set_bbox_changed()
  8857. }
  8858. };
  8859. c.X = function(e) {
  8860. e.set_float(this.x)
  8861. };
  8862. c.Y = function(e) {
  8863. e.set_float(this.y)
  8864. };
  8865. c.dt = function(e) {
  8866. e.set_float(this.runtime.getDt(this))
  8867. }
  8868. }
  8869. if (i) {
  8870. f.CompareWidth = function(e, t) {
  8871. return cr.do_cmp(this.width, e, t)
  8872. };
  8873. f.CompareHeight = function(e, t) {
  8874. return cr.do_cmp(this.height, e, t)
  8875. };
  8876. l.SetWidth = function(e) {
  8877. if (this.width !== e) {
  8878. this.width = e;
  8879. this.set_bbox_changed()
  8880. }
  8881. };
  8882. l.SetHeight = function(e) {
  8883. if (this.height !== e) {
  8884. this.height = e;
  8885. this.set_bbox_changed()
  8886. }
  8887. };
  8888. l.SetSize = function(e, t) {
  8889. if (this.width !== e || this.height !== t) {
  8890. this.width = e;
  8891. this.height = t;
  8892. this.set_bbox_changed()
  8893. }
  8894. };
  8895. c.Width = function(e) {
  8896. e.set_float(this.width)
  8897. };
  8898. c.Height = function(e) {
  8899. e.set_float(this.height)
  8900. };
  8901. c.BBoxLeft = function(e) {
  8902. this.update_bbox();
  8903. e.set_float(this.bbox.left)
  8904. };
  8905. c.BBoxTop = function(e) {
  8906. this.update_bbox();
  8907. e.set_float(this.bbox.top)
  8908. };
  8909. c.BBoxRight = function(e) {
  8910. this.update_bbox();
  8911. e.set_float(this.bbox.right)
  8912. };
  8913. c.BBoxBottom = function(e) {
  8914. this.update_bbox();
  8915. e.set_float(this.bbox.bottom)
  8916. }
  8917. }
  8918. if (s) {
  8919. f.AngleWithin = function(e, t) {
  8920. return cr.angleDiff(this.angle, cr.to_radians(t)) <= cr.to_radians(e)
  8921. };
  8922. f.IsClockwiseFrom = function(e) {
  8923. return cr.angleClockwise(this.angle, cr.to_radians(e))
  8924. };
  8925. f.IsBetweenAngles = function(e, t) {
  8926. var n = cr.to_clamped_radians(e);
  8927. var r = cr.to_clamped_radians(t);
  8928. var i = cr.clamp_angle(this.angle);
  8929. var s = !cr.angleClockwise(r, n);
  8930. if (s) return !(!cr.angleClockwise(i, n) && cr.angleClockwise(i, r));
  8931. else return cr.angleClockwise(i, n) && !cr.angleClockwise(i, r)
  8932. };
  8933. l.SetAngle = function(e) {
  8934. var t = cr.to_radians(cr.clamp_angle_degrees(e));
  8935. if (isNaN(t)) return;
  8936. if (this.angle !== t) {
  8937. this.angle = t;
  8938. this.set_bbox_changed()
  8939. }
  8940. };
  8941. l.RotateClockwise = function(e) {
  8942. if (e !== 0 && !isNaN(e)) {
  8943. this.angle += cr.to_radians(e);
  8944. this.angle = cr.clamp_angle(this.angle);
  8945. this.set_bbox_changed()
  8946. }
  8947. };
  8948. l.RotateCounterclockwise = function(e) {
  8949. if (e !== 0 && !isNaN(e)) {
  8950. this.angle -= cr.to_radians(e);
  8951. this.angle = cr.clamp_angle(this.angle);
  8952. this.set_bbox_changed()
  8953. }
  8954. };
  8955. l.RotateTowardAngle = function(e, t) {
  8956. var n = cr.angleRotate(this.angle, cr.to_radians(t), cr.to_radians(e));
  8957. if (isNaN(n)) return;
  8958. if (this.angle !== n) {
  8959. this.angle = n;
  8960. this.set_bbox_changed()
  8961. }
  8962. };
  8963. l.RotateTowardPosition = function(e, t, n) {
  8964. var r = t - this.x;
  8965. var i = n - this.y;
  8966. var s = Math.atan2(i, r);
  8967. var o = cr.angleRotate(this.angle, s, cr.to_radians(e));
  8968. if (isNaN(o)) return;
  8969. if (this.angle !== o) {
  8970. this.angle = o;
  8971. this.set_bbox_changed()
  8972. }
  8973. };
  8974. l.SetTowardPosition = function(e, t) {
  8975. var n = e - this.x;
  8976. var r = t - this.y;
  8977. var i = Math.atan2(r, n);
  8978. if (isNaN(i)) return;
  8979. if (this.angle !== i) {
  8980. this.angle = i;
  8981. this.set_bbox_changed()
  8982. }
  8983. };
  8984. c.Angle = function(e) {
  8985. e.set_float(cr.to_clamped_degrees(this.angle))
  8986. }
  8987. }
  8988. if (!n) {
  8989. f.CompareInstanceVar = function(e, t, n) {
  8990. return cr.do_cmp(this.instance_vars[e], t, n)
  8991. };
  8992. f.IsBoolInstanceVarSet = function(e) {
  8993. return this.instance_vars[e]
  8994. };
  8995. f.PickInstVarHiLow = function(e, t) {
  8996. var n = this.getCurrentSol();
  8997. var r = n.getObjects();
  8998. if (!r.length) return false;
  8999. var i = r[0];
  9000. var s = i;
  9001. var o = i.instance_vars[t];
  9002. var u, a, f;
  9003. for (u = 1, a = r.length; u < a; u++) {
  9004. i = r[u];
  9005. f = i.instance_vars[t];
  9006. if (e === 0 && f < o || e === 1 && f > o) {
  9007. o = f;
  9008. s = i
  9009. }
  9010. }
  9011. n.pick_one(s);
  9012. return true
  9013. };
  9014. f.PickByUID = function(e) {
  9015. var t, n, r, i, s, o, u;
  9016. var a = this.runtime.getCurrentCondition();
  9017. if (a.inverted) {
  9018. u = this.getCurrentSol();
  9019. if (u.select_all) {
  9020. u.select_all = false;
  9021. u.instances.length = 0;
  9022. u.else_instances.length = 0;
  9023. o = this.instances;
  9024. for (t = 0, n = o.length; t < n; t++) {
  9025. i = o[t];
  9026. if (i.uid === e) u.else_instances.push(i);
  9027. else u.instances.push(i)
  9028. }
  9029. return !!u.instances.length
  9030. } else {
  9031. for (t = 0, r = 0, n = u.instances.length; t < n; t++) {
  9032. i = u.instances[t];
  9033. u.instances[r] = i;
  9034. if (i.uid === e) {
  9035. u.else_instances.push(i)
  9036. } else r++
  9037. }
  9038. u.instances.length = r;
  9039. return !!u.instances.length
  9040. }
  9041. } else {
  9042. i = this.runtime.getObjectByUID(e);
  9043. if (!i) return false;
  9044. u = this.getCurrentSol();
  9045. if (!u.select_all && u.instances.indexOf(i) === -1) return false;
  9046. if (this.is_family) {
  9047. s = i.type.families;
  9048. for (t = 0, n = s.length; t < n; t++) {
  9049. if (s[t] === this) {
  9050. u.pick_one(i);
  9051. return true
  9052. }
  9053. }
  9054. } else if (i.type === this) {
  9055. u.pick_one(i);
  9056. return true
  9057. }
  9058. return false
  9059. }
  9060. };
  9061. f.OnCreated = function() {
  9062. return true
  9063. };
  9064. f.OnDestroyed = function() {
  9065. return true
  9066. };
  9067. l.SetInstanceVar = function(e, t) {
  9068. var n = this.instance_vars;
  9069. if (cr.is_number(n[e])) {
  9070. if (cr.is_number(t)) n[e] = t;
  9071. else n[e] = parseFloat(t)
  9072. } else if (cr.is_string(n[e])) {
  9073. if (cr.is_string(t)) n[e] = t;
  9074. else n[e] = t.toString()
  9075. } else;
  9076. };
  9077. l.AddInstanceVar = function(e, t) {
  9078. var n = this.instance_vars;
  9079. if (cr.is_number(n[e])) {
  9080. if (cr.is_number(t)) n[e] += t;
  9081. else n[e] += parseFloat(t)
  9082. } else if (cr.is_string(n[e])) {
  9083. if (cr.is_string(t)) n[e] += t;
  9084. else n[e] += t.toString()
  9085. } else;
  9086. };
  9087. l.SubInstanceVar = function(e, t) {
  9088. var n = this.instance_vars;
  9089. if (cr.is_number(n[e])) {
  9090. if (cr.is_number(t)) n[e] -= t;
  9091. else n[e] -= parseFloat(t)
  9092. } else;
  9093. };
  9094. l.SetBoolInstanceVar = function(e, t) {
  9095. this.instance_vars[e] = t ? 1 : 0
  9096. };
  9097. l.ToggleBoolInstanceVar = function(e) {
  9098. this.instance_vars[e] = 1 - this.instance_vars[e]
  9099. };
  9100. l.Destroy = function() {
  9101. this.runtime.DestroyInstance(this)
  9102. };
  9103. c.Count = function(e) {
  9104. var t = e.object_class.instances.length;
  9105. var n, r, i;
  9106. for (n = 0, r = this.runtime.createRow.length; n < r; n++) {
  9107. i = this.runtime.createRow[n];
  9108. if (e.object_class.is_family) {
  9109. if (i.type.families.indexOf(e.object_class) >= 0) t++
  9110. } else {
  9111. if (i.type === e.object_class) t++
  9112. }
  9113. }
  9114. e.set_int(t)
  9115. };
  9116. c.PickedCount = function(e) {
  9117. e.set_int(e.object_class.getCurrentSol().getObjects().length)
  9118. };
  9119. c.UID = function(e) {
  9120. e.set_int(this.uid)
  9121. };
  9122. c.IID = function(e) {
  9123. e.set_int(this.get_iid())
  9124. }
  9125. }
  9126. if (o) {
  9127. f.IsVisible = function() {
  9128. return this.visible
  9129. };
  9130. l.SetVisible = function(e) {
  9131. if (!e !== !this.visible) {
  9132. this.visible = e;
  9133. this.runtime.redraw = true
  9134. }
  9135. };
  9136. f.CompareOpacity = function(e, t) {
  9137. return cr.do_cmp(cr.round6dp(this.opacity * 100), e, t)
  9138. };
  9139. l.SetOpacity = function(e) {
  9140. var t = e / 100;
  9141. if (t < 0) t = 0;
  9142. else if (t > 1) t = 1;
  9143. if (t !== this.opacity) {
  9144. this.opacity = t;
  9145. this.runtime.redraw = true
  9146. }
  9147. };
  9148. c.Opacity = function(e) {
  9149. e.set_float(cr.round6dp(this.opacity * 100))
  9150. }
  9151. }
  9152. if (u) {
  9153. f.IsOnLayer = function(e) {
  9154. if (!e) return false;
  9155. return this.layer === e
  9156. };
  9157. f.PickTopBottom = function(e) {
  9158. var t = this.getCurrentSol();
  9159. var n = t.getObjects();
  9160. if (!n.length) return false;
  9161. var r = n[0];
  9162. var i = r;
  9163. var s, o;
  9164. for (s = 1, o = n.length; s < o; s++) {
  9165. r = n[s];
  9166. if (e === 0) {
  9167. if (r.layer.index > i.layer.index || r.layer.index === i.layer.index && r.get_zindex() > i.get_zindex()) {
  9168. i = r
  9169. }
  9170. } else {
  9171. if (r.layer.index < i.layer.index || r.layer.index === i.layer.index && r.get_zindex() < i.get_zindex()) {
  9172. i = r
  9173. }
  9174. }
  9175. }
  9176. t.pick_one(i);
  9177. return true
  9178. };
  9179. l.MoveToTop = function() {
  9180. var e = this.get_zindex();
  9181. if (e === this.layer.instances.length - 1) return;
  9182. cr.arrayRemove(this.layer.instances, e);
  9183. this.layer.instances.push(this);
  9184. this.runtime.redraw = true;
  9185. this.layer.zindices_stale = true
  9186. };
  9187. l.MoveToBottom = function() {
  9188. var e = this.get_zindex();
  9189. if (e === 0) return;
  9190. cr.arrayRemove(this.layer.instances, e);
  9191. this.layer.instances.unshift(this);
  9192. this.runtime.redraw = true;
  9193. this.layer.zindices_stale = true
  9194. };
  9195. l.MoveToLayer = function(e) {
  9196. if (!e || e == this.layer) return;
  9197. cr.arrayRemove(this.layer.instances, this.get_zindex());
  9198. this.layer.zindices_stale = true;
  9199. this.layer = e;
  9200. this.zindex = e.instances.length;
  9201. e.instances.push(this);
  9202. this.runtime.redraw = true
  9203. };
  9204. l.ZMoveToObject = function(e, t) {
  9205. var n = e === 0;
  9206. if (!t) return;
  9207. var r = t.getFirstPicked(this);
  9208. if (!r || r.uid === this.uid) return;
  9209. if (this.layer.index !== r.layer.index) {
  9210. cr.arrayRemove(this.layer.instances, this.get_zindex());
  9211. this.layer.zindices_stale = true;
  9212. this.layer = r.layer;
  9213. this.zindex = r.layer.instances.length;
  9214. r.layer.instances.push(this)
  9215. }
  9216. var i = this.get_zindex();
  9217. var s = r.get_zindex();
  9218. cr.arrayRemove(this.layer.instances, i);
  9219. if (i < s) s--;
  9220. if (n) s++;
  9221. if (s === this.layer.instances.length) this.layer.instances.push(this);
  9222. else this.layer.instances.splice(s, 0, this);
  9223. this.layer.zindices_stale = true;
  9224. this.runtime.redraw = true
  9225. };
  9226. c.LayerNumber = function(e) {
  9227. e.set_int(this.layer.number)
  9228. };
  9229. c.LayerName = function(e) {
  9230. e.set_string(this.layer.name)
  9231. };
  9232. c.ZIndex = function(e) {
  9233. e.set_int(this.get_zindex())
  9234. }
  9235. }
  9236. if (a) {
  9237. l.SetEffectEnabled = function(e, t) {
  9238. if (!this.runtime.glwrap) return;
  9239. var n = this.type.getEffectIndexByName(t);
  9240. if (n < 0) return;
  9241. var r = e === 1;
  9242. if (this.active_effect_flags[n] === r) return;
  9243. this.active_effect_flags[n] = r;
  9244. this.updateActiveEffects();
  9245. this.runtime.redraw = true
  9246. };
  9247. l.SetEffectParam = function(e, t, n) {
  9248. if (!this.runtime.glwrap) return;
  9249. var r = this.type.getEffectIndexByName(e);
  9250. if (r < 0) return;
  9251. var i = this.type.effect_types[r];
  9252. var s = this.effect_params[r];
  9253. t = Math.floor(t);
  9254. if (t < 0 || t >= s.length) return;
  9255. if (this.runtime.glwrap.getProgramParameterType(i.shaderindex, t) === 1) n /= 100;
  9256. if (s[t] === n) return;
  9257. s[t] = n;
  9258. if (i.active) this.runtime.redraw = true
  9259. }
  9260. }
  9261. };
  9262. cr.set_bbox_changed = function() {
  9263. this.bbox_changed = true;
  9264. this.runtime.redraw = true;
  9265. var e, t;
  9266. for (e = 0, t = this.bbox_changed_callbacks.length; e < t; e++) {
  9267. this.bbox_changed_callbacks[e](this)
  9268. }
  9269. };
  9270. cr.add_bbox_changed_callback = function(e) {
  9271. if (e) this.bbox_changed_callbacks.push(e)
  9272. };
  9273. cr.update_bbox = function() {
  9274. if (!this.bbox_changed) return;
  9275. this.bbox.set(this.x, this.y, this.x + this.width, this.y + this.height);
  9276. this.bbox.offset(-this.hotspotX * this.width, -this.hotspotY * this.height);
  9277. if (!this.angle) {
  9278. this.bquad.set_from_rect(this.bbox)
  9279. } else {
  9280. this.bbox.offset(-this.x, -this.y);
  9281. this.bquad.set_from_rotated_rect(this.bbox, this.angle);
  9282. this.bquad.offset(this.x, this.y);
  9283. this.bquad.bounding_box(this.bbox)
  9284. }
  9285. var e = 0;
  9286. if (this.bbox.left > this.bbox.right) {
  9287. e = this.bbox.left;
  9288. this.bbox.left = this.bbox.right;
  9289. this.bbox.right = e
  9290. }
  9291. if (this.bbox.top > this.bbox.bottom) {
  9292. e = this.bbox.top;
  9293. this.bbox.top = this.bbox.bottom;
  9294. this.bbox.bottom = e
  9295. }
  9296. this.bbox_changed = false
  9297. };
  9298. cr.inst_contains_pt = function(e, t) {
  9299. if (!this.bbox.contains_pt(e, t)) return false;
  9300. if (!this.bquad.contains_pt(e, t)) return false;
  9301. if (this.collision_poly && !this.collision_poly.is_empty()) {
  9302. this.collision_poly.cache_poly(this.width, this.height, this.angle);
  9303. return this.collision_poly.contains_pt(e - this.x, t - this.y)
  9304. } else return true
  9305. };
  9306. cr.inst_get_iid = function() {
  9307. this.type.updateIIDs();
  9308. return this.iid
  9309. };
  9310. cr.inst_get_zindex = function() {
  9311. this.layer.updateZIndices();
  9312. return this.zindex
  9313. };
  9314. cr.inst_updateActiveEffects = function() {
  9315. this.active_effect_types.length = 0;
  9316. var e, t, n, r;
  9317. for (e = 0, t = this.active_effect_flags.length; e < t; e++) {
  9318. if (this.active_effect_flags[e]) this.active_effect_types.push(this.type.effect_types[e])
  9319. }
  9320. this.uses_shaders = !!this.active_effect_types.length
  9321. };
  9322. cr.inst_toString = function() {
  9323. return "Inst" + this.puid
  9324. };
  9325. cr.type_getFirstPicked = function(e) {
  9326. if (e && e.is_contained && e.type != this) {
  9327. var t, n, r;
  9328. for (t = 0, n = e.siblings.length; t < n; t++) {
  9329. r = e.siblings[t];
  9330. if (r.type == this) return r
  9331. }
  9332. }
  9333. var i = this.getCurrentSol().getObjects();
  9334. if (i.length) return i[0];
  9335. else return null
  9336. };
  9337. cr.type_getPairedInstance = function(e) {
  9338. var t = this.getCurrentSol().getObjects();
  9339. if (t.length) return t[e.get_iid() % t.length];
  9340. else return null
  9341. };
  9342. cr.type_updateIIDs = function() {
  9343. if (!this.stale_iids || this.is_family) return;
  9344. var e, t;
  9345. for (e = 0, t = this.instances.length; e < t; e++) this.instances[e].iid = e;
  9346. var n = e;
  9347. var r = this.runtime.createRow;
  9348. for (e = 0, t = r.length; e < t; ++e) {
  9349. if (r[e].type === this) r[e].iid = n++
  9350. }
  9351. this.stale_iids = false
  9352. };
  9353. cr.type_getCurrentSol = function() {
  9354. return this.solstack[this.cur_sol]
  9355. };
  9356. cr.type_pushCleanSol = function() {
  9357. this.cur_sol++;
  9358. if (this.cur_sol === this.solstack.length) this.solstack.push(new cr.selection(this));
  9359. else this.solstack[this.cur_sol].select_all = true
  9360. };
  9361. cr.type_pushCopySol = function() {
  9362. this.cur_sol++;
  9363. if (this.cur_sol === this.solstack.length) this.solstack.push(new cr.selection(this));
  9364. var e = this.solstack[this.cur_sol];
  9365. var t = this.solstack[this.cur_sol - 1];
  9366. if (t.select_all) e.select_all = true;
  9367. else {
  9368. e.select_all = false;
  9369. cr.shallowAssignArray(e.instances, t.instances);
  9370. cr.shallowAssignArray(e.else_instances, t.else_instances)
  9371. }
  9372. };
  9373. cr.type_popSol = function() {
  9374. this.cur_sol--
  9375. };
  9376. cr.type_getBehaviorByName = function(e) {
  9377. var t, n, r, i, s, o = 0;
  9378. if (!this.is_family) {
  9379. for (t = 0, n = this.families.length; t < n; t++) {
  9380. s = this.families[t];
  9381. for (r = 0, i = s.behaviors.length; r < i; r++) {
  9382. if (e === s.behaviors[r].name) {
  9383. this.extra.lastBehIndex = o;
  9384. return s.behaviors[r]
  9385. }
  9386. o++
  9387. }
  9388. }
  9389. }
  9390. for (t = 0, n = this.behaviors.length; t < n; t++) {
  9391. if (e === this.behaviors[t].name) {
  9392. this.extra.lastBehIndex = o;
  9393. return this.behaviors[t]
  9394. }
  9395. o++
  9396. }
  9397. return null
  9398. };
  9399. cr.type_getBehaviorIndexByName = function(e) {
  9400. var t = this.getBehaviorByName(e);
  9401. if (t) return this.extra.lastBehIndex;
  9402. else return -1
  9403. };
  9404. cr.type_getEffectIndexByName = function(e) {
  9405. var t, n;
  9406. for (t = 0, n = this.effect_types.length; t < n; t++) {
  9407. if (this.effect_types[t].name === e) return t
  9408. }
  9409. return -1
  9410. };
  9411. cr.type_applySolToContainer = function() {
  9412. if (!this.is_contained || this.is_family) return;
  9413. var e, t, n, r, i, s, o;
  9414. this.updateIIDs();
  9415. s = this.getCurrentSol();
  9416. var u = s.select_all;
  9417. var a = this.runtime.getCurrentEventStack();
  9418. var f = a && a.current_event && a.current_event.orblock;
  9419. for (e = 0, t = this.container.length; e < t; e++) {
  9420. i = this.container[e];
  9421. if (i === this) continue;
  9422. i.updateIIDs();
  9423. o = i.getCurrentSol();
  9424. o.select_all = u;
  9425. if (!u) {
  9426. o.instances.length = s.instances.length;
  9427. for (n = 0, r = s.instances.length; n < r; n++) o.instances[n] = i.instances[s.instances[n].iid];
  9428. if (f) {
  9429. o.else_instances.length = s.else_instances.length;
  9430. for (n = 0, r = s.else_instances.length; n < r; n++) o.else_instances[n] = i.instances[s.else_instances[n].iid]
  9431. }
  9432. }
  9433. }
  9434. };
  9435. cr.type_toString = function() {
  9436. return "Type" + this.sid
  9437. };
  9438. cr.do_cmp = function(e, t, n) {
  9439. if (typeof e === "undefined" || typeof n === "undefined") return false;
  9440. switch (t) {
  9441. case 0:
  9442. return e === n;
  9443. case 1:
  9444. return e !== n;
  9445. case 2:
  9446. return e < n;
  9447. case 3:
  9448. return e <= n;
  9449. case 4:
  9450. return e > n;
  9451. case 5:
  9452. return e >= n;
  9453. default:
  9454. return false
  9455. }
  9456. };
  9457. cr.shaders = {};
  9458. cr.plugins_.Browser = function(e) {
  9459. this.runtime = e
  9460. };
  9461. (function() {
  9462. function Cnds() {}
  9463. function Acts() {}
  9464. function onFullscreenError() {
  9465. if (typeof jQuery !== "undefined") {
  9466. crruntime["setSize"](jQuery(window).width(), jQuery(window).height())
  9467. }
  9468. }
  9469. function Exps() {}
  9470. var pluginProto = cr.plugins_.Browser.prototype;
  9471. pluginProto.Type = function(e) {
  9472. this.plugin = e;
  9473. this.runtime = e.runtime
  9474. };
  9475. var typeProto = pluginProto.Type.prototype;
  9476. typeProto.onCreate = function() {};
  9477. pluginProto.Instance = function(e) {
  9478. this.type = e;
  9479. this.runtime = e.runtime
  9480. };
  9481. var instanceProto = pluginProto.Instance.prototype;
  9482. instanceProto.onCreate = function() {
  9483. var e = this;
  9484. window.addEventListener("resize", function() {
  9485. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnResize, e)
  9486. });
  9487. if (typeof navigator.onLine !== "undefined") {
  9488. window.addEventListener("online", function() {
  9489. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnOnline, e)
  9490. });
  9491. window.addEventListener("offline", function() {
  9492. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnOffline, e)
  9493. })
  9494. }
  9495. if (typeof window.applicationCache !== "undefined") {
  9496. window.applicationCache.addEventListener("updateready", function() {
  9497. e.runtime.loadingprogress = 1;
  9498. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnUpdateReady, e)
  9499. });
  9500. window.applicationCache.addEventListener("progress", function(t) {
  9501. e.runtime.loadingprogress = t["loaded"] / t["total"]
  9502. })
  9503. }
  9504. if (!this.runtime.isDirectCanvas) {
  9505. document.addEventListener("appMobi.device.update.available", function() {
  9506. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnUpdateReady, e)
  9507. });
  9508. document.addEventListener("menubutton", function() {
  9509. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnMenuButton, e)
  9510. });
  9511. document.addEventListener("searchbutton", function() {
  9512. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnSearchButton, e)
  9513. });
  9514. document.addEventListener("tizenhwkey", function(t) {
  9515. var n;
  9516. switch (t["keyName"]) {
  9517. case "back":
  9518. n = e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnBackButton, e);
  9519. if (!n) {
  9520. if (window["tizen"]) window["tizen"]["application"]["getCurrentApplication"]()["exit"]()
  9521. }
  9522. break;
  9523. case "menu":
  9524. n = e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnMenuButton, e);
  9525. if (!n) t.preventDefault();
  9526. break
  9527. }
  9528. })
  9529. }
  9530. this.runtime.addSuspendCallback(function(t) {
  9531. if (t) {
  9532. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnPageHidden, e)
  9533. } else {
  9534. e.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnPageVisible, e)
  9535. }
  9536. });
  9537. this.is_arcade = typeof window["is_scirra_arcade"] !== "undefined";
  9538. this.fullscreenOldMarginCss = ""
  9539. };
  9540. Cnds.prototype.CookiesEnabled = function() {
  9541. return navigator ? navigator.cookieEnabled : false
  9542. };
  9543. Cnds.prototype.IsOnline = function() {
  9544. return navigator ? navigator.onLine : false
  9545. };
  9546. Cnds.prototype.HasJava = function() {
  9547. return navigator ? navigator.javaEnabled() : false
  9548. };
  9549. Cnds.prototype.OnOnline = function() {
  9550. return true
  9551. };
  9552. Cnds.prototype.OnOffline = function() {
  9553. return true
  9554. };
  9555. Cnds.prototype.IsDownloadingUpdate = function() {
  9556. if (typeof window["applicationCache"] === "undefined") return false;
  9557. else return window["applicationCache"]["status"] === window["applicationCache"]["DOWNLOADING"]
  9558. };
  9559. Cnds.prototype.OnUpdateReady = function() {
  9560. return true
  9561. };
  9562. Cnds.prototype.PageVisible = function() {
  9563. return !this.runtime.isSuspended
  9564. };
  9565. Cnds.prototype.OnPageVisible = function() {
  9566. return true
  9567. };
  9568. Cnds.prototype.OnPageHidden = function() {
  9569. return true
  9570. };
  9571. Cnds.prototype.OnResize = function() {
  9572. return true
  9573. };
  9574. Cnds.prototype.IsFullscreen = function() {
  9575. return !!(document["mozFullScreen"] || document["webkitIsFullScreen"] || document["fullScreen"] || this.runtime.isNodeFullscreen)
  9576. };
  9577. Cnds.prototype.OnBackButton = function() {
  9578. return true
  9579. };
  9580. Cnds.prototype.OnMenuButton = function() {
  9581. return true
  9582. };
  9583. Cnds.prototype.OnSearchButton = function() {
  9584. return true
  9585. };
  9586. Cnds.prototype.IsMetered = function() {
  9587. var e = navigator["connection"] || navigator["mozConnection"] || navigator["webkitConnection"];
  9588. if (!e) return false;
  9589. return e["metered"]
  9590. };
  9591. Cnds.prototype.IsCharging = function() {
  9592. var e = navigator["battery"] || navigator["mozBattery"] || navigator["webkitBattery"];
  9593. if (!e) return true;
  9594. return e["charging"]
  9595. };
  9596. Cnds.prototype.IsPortraitLandscape = function(e) {
  9597. var t = window.innerWidth <= window.innerHeight ? 0 : 1;
  9598. return t === e
  9599. };
  9600. pluginProto.cnds = new Cnds;
  9601. Acts.prototype.Alert = function(e) {
  9602. if (!this.runtime.isDomFree) alert(e.toString())
  9603. };
  9604. Acts.prototype.Close = function() {
  9605. if (this.runtime.isCocoonJs) CocoonJS["App"]["forceToFinish"]();
  9606. else if (!this.is_arcade && !this.runtime.isDomFree) window.close()
  9607. };
  9608. Acts.prototype.Focus = function() {
  9609. if (this.runtime.isNodeWebkit) {
  9610. var e = window["nwgui"]["Window"]["get"]();
  9611. e["focus"]()
  9612. } else if (!this.is_arcade && !this.runtime.isDomFree) window.focus()
  9613. };
  9614. Acts.prototype.Blur = function() {
  9615. if (this.runtime.isNodeWebkit) {
  9616. var e = window["nwgui"]["Window"]["get"]();
  9617. e["blur"]()
  9618. } else if (!this.is_arcade && !this.runtime.isDomFree) window.blur()
  9619. };
  9620. Acts.prototype.GoBack = function() {
  9621. if (!this.is_arcade && !this.runtime.isDomFree && window.back) window.back()
  9622. };
  9623. Acts.prototype.GoForward = function() {
  9624. if (!this.is_arcade && !this.runtime.isDomFree && window.forward) window.forward()
  9625. };
  9626. Acts.prototype.GoHome = function() {
  9627. if (!this.is_arcade && !this.runtime.isDomFree && window.home) window.home()
  9628. };
  9629. Acts.prototype.GoToURL = function(e) {
  9630. if (this.runtime.isCocoonJs) CocoonJS["App"]["openURL"](e);
  9631. else if (!this.is_arcade && !this.runtime.isDomFree) window.location = e
  9632. };
  9633. Acts.prototype.GoToURLWindow = function(e, t) {
  9634. if (this.runtime.isCocoonJs) CocoonJS["App"]["openURL"](e);
  9635. else if (!this.is_arcade && !this.runtime.isDomFree) window.open(e, t)
  9636. };
  9637. Acts.prototype.Reload = function() {
  9638. if (!this.is_arcade && !this.runtime.isDomFree) window.location.reload()
  9639. };
  9640. var firstRequestFullscreen = true;
  9641. var crruntime = null;
  9642. Acts.prototype.RequestFullScreen = function(e) {
  9643. if (this.runtime.isDomFree) {
  9644. cr.logexport("[Construct 2] Requesting fullscreen is not supported on this platform - the request has been ignored");
  9645. return
  9646. }
  9647. if (e >= 2) e += 1;
  9648. if (e === 6) e = 2;
  9649. if (this.runtime.isNodeWebkit) {
  9650. if (!this.runtime.isNodeFullscreen) {
  9651. window["nwgui"]["Window"]["get"]()["enterFullscreen"]();
  9652. this.runtime.isNodeFullscreen = true
  9653. }
  9654. } else {
  9655. if (document["mozFullScreen"] || document["webkitIsFullScreen"] || !!document["msFullscreenElement"] || document["fullScreen"]) {
  9656. return
  9657. }
  9658. this.fullscreenOldMarginCss = jQuery(this.runtime.canvasdiv).css("margin");
  9659. jQuery(this.runtime.canvasdiv).css("margin", "0");
  9660. window["c2resizestretchmode"] = e > 0 ? 1 : 0;
  9661. this.runtime.fullscreen_scaling = e >= 2 ? e : 0;
  9662. var t = this.runtime.canvasdiv || this.runtime.canvas;
  9663. if (firstRequestFullscreen) {
  9664. firstRequestFullscreen = false;
  9665. crruntime = this.runtime;
  9666. t.addEventListener("mozfullscreenerror", onFullscreenError);
  9667. t.addEventListener("webkitfullscreenerror", onFullscreenError);
  9668. t.addEventListener("msfullscreenerror", onFullscreenError);
  9669. t.addEventListener("fullscreenerror", onFullscreenError)
  9670. }
  9671. if (!cr.is_undefined(t["webkitRequestFullScreen"])) {
  9672. if (typeof Element !== "undefined" && typeof Element["ALLOW_KEYBOARD_INPUT"] !== "undefined") t["webkitRequestFullScreen"](Element["ALLOW_KEYBOARD_INPUT"]);
  9673. else t["webkitRequestFullScreen"]()
  9674. } else if (!cr.is_undefined(t["mozRequestFullScreen"])) t["mozRequestFullScreen"]();
  9675. else if (!cr.is_undefined(t["msRequestFullscreen"])) t["msRequestFullscreen"]();
  9676. else if (!cr.is_undefined(t["requestFullscreen"])) t["requestFullscreen"]()
  9677. }
  9678. };
  9679. Acts.prototype.CancelFullScreen = function() {
  9680. if (this.runtime.isDomFree) {
  9681. cr.logexport("[Construct 2] Exiting fullscreen is not supported on this platform - the request has been ignored");
  9682. return
  9683. }
  9684. if (this.runtime.isNodeWebkit) {
  9685. if (this.runtime.isNodeFullscreen) {
  9686. window["nwgui"]["Window"]["get"]()["leaveFullscreen"]();
  9687. this.runtime.isNodeFullscreen = false
  9688. }
  9689. } else {
  9690. if (!cr.is_undefined(document["webkitCancelFullScreen"])) document["webkitCancelFullScreen"]();
  9691. else if (!cr.is_undefined(document["mozCancelFullScreen"])) document["mozCancelFullScreen"]();
  9692. else if (!cr.is_undefined(document["msExitFullscreen"])) document["msExitFullscreen"]();
  9693. else if (!cr.is_undefined(document["exitFullscreen"])) document["exitFullscreen"]();
  9694. jQuery(this.runtime.canvasdiv).css("margin", this.fullscreenOldMarginCss)
  9695. }
  9696. };
  9697. Acts.prototype.Vibrate = function(e) {
  9698. try {
  9699. var t = e.split(",");
  9700. var n, r;
  9701. for (n = 0, r = t.length; n < r; n++) {
  9702. t[n] = parseInt(t[n], 10)
  9703. }
  9704. if (navigator["vibrate"]) navigator["vibrate"](t);
  9705. else if (navigator["mozVibrate"]) navigator["mozVibrate"](t);
  9706. else if (navigator["webkitVibrate"]) navigator["webkitVibrate"](t)
  9707. } catch (i) {}
  9708. };
  9709. Acts.prototype.InvokeDownload = function(e, t) {
  9710. var n = document.createElement("a");
  9711. if (typeof n.download === "undefined") {
  9712. window.open(e)
  9713. } else {
  9714. var r = document.getElementsByTagName("body")[0];
  9715. n.textContent = t;
  9716. n.href = e;
  9717. n.download = t;
  9718. r.appendChild(n);
  9719. var i = document.createEvent("MouseEvent");
  9720. i.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  9721. n.dispatchEvent(i);
  9722. r.removeChild(n)
  9723. }
  9724. };
  9725. Acts.prototype.ConsoleLog = function(e, t) {
  9726. if (!console) return;
  9727. if (e === 0 && console.log) console.log(t.toString());
  9728. if (e === 1 && console.warn) console.warn(t.toString());
  9729. if (e === 2 && console.error) console.error(t.toString())
  9730. };
  9731. Acts.prototype.ConsoleGroup = function(e) {
  9732. if (console && console.group) console.group(e)
  9733. };
  9734. Acts.prototype.ConsoleGroupEnd = function() {
  9735. if (console && console.groupEnd) console.groupEnd()
  9736. };
  9737. Acts.prototype.ExecJs = function(js_) {
  9738. if (eval) eval(js_)
  9739. };
  9740. var orientations = ["portrait", "landscape", "portrait-primary", "portrait-secondary", "landscape-primary", "landscape-secondary"];
  9741. Acts.prototype.LockOrientation = function(e) {
  9742. e = Math.floor(e);
  9743. if (e < 0 || e >= orientations.length) return;
  9744. var t = orientations[e];
  9745. if (screen["lockOrientation"]) screen["lockOrientation"](t);
  9746. else if (screen["webkitLockOrientation"]) screen["webkitLockOrientation"](t);
  9747. else if (screen["mozLockOrientation"]) screen["mozLockOrientation"](t);
  9748. else if (screen["msLockOrientation"]) screen["msLockOrientation"](t)
  9749. };
  9750. Acts.prototype.UnlockOrientation = function() {
  9751. if (screen["unlockOrientation"]) screen["unlockOrientation"]();
  9752. else if (screen["webkitUnlockOrientation"]) screen["webkitUnlockOrientation"]();
  9753. else if (screen["mozUnlockOrientation"]) screen["mozUnlockOrientation"]();
  9754. else if (screen["msUnlockOrientation"]) screen["msUnlockOrientation"]()
  9755. };
  9756. pluginProto.acts = new Acts;
  9757. Exps.prototype.URL = function(e) {
  9758. e.set_string(this.runtime.isDomFree ? "" : window.location.toString())
  9759. };
  9760. Exps.prototype.Protocol = function(e) {
  9761. e.set_string(this.runtime.isDomFree ? "" : window.location.protocol)
  9762. };
  9763. Exps.prototype.Domain = function(e) {
  9764. e.set_string(this.runtime.isDomFree ? "" : window.location.hostname)
  9765. };
  9766. Exps.prototype.PathName = function(e) {
  9767. e.set_string(this.runtime.isDomFree ? "" : window.location.pathname)
  9768. };
  9769. Exps.prototype.Hash = function(e) {
  9770. e.set_string(this.runtime.isDomFree ? "" : window.location.hash)
  9771. };
  9772. Exps.prototype.Referrer = function(e) {
  9773. e.set_string(this.runtime.isDomFree ? "" : document.referrer)
  9774. };
  9775. Exps.prototype.Title = function(e) {
  9776. e.set_string(this.runtime.isDomFree ? "" : document.title)
  9777. };
  9778. Exps.prototype.Name = function(e) {
  9779. e.set_string(this.runtime.isDomFree ? "" : navigator.appName)
  9780. };
  9781. Exps.prototype.Version = function(e) {
  9782. e.set_string(this.runtime.isDomFree ? "" : navigator.appVersion)
  9783. };
  9784. Exps.prototype.Language = function(e) {
  9785. if (navigator && navigator.language) e.set_string(navigator.language);
  9786. else e.set_string("")
  9787. };
  9788. Exps.prototype.Platform = function(e) {
  9789. e.set_string(this.runtime.isDomFree ? "" : navigator.platform)
  9790. };
  9791. Exps.prototype.Product = function(e) {
  9792. if (navigator && navigator.product) e.set_string(navigator.product);
  9793. else e.set_string("")
  9794. };
  9795. Exps.prototype.Vendor = function(e) {
  9796. if (navigator && navigator.vendor) e.set_string(navigator.vendor);
  9797. else e.set_string("")
  9798. };
  9799. Exps.prototype.UserAgent = function(e) {
  9800. e.set_string(this.runtime.isDomFree ? "" : navigator.userAgent)
  9801. };
  9802. Exps.prototype.QueryString = function(e) {
  9803. e.set_string(this.runtime.isDomFree ? "" : window.location.search)
  9804. };
  9805. Exps.prototype.QueryParam = function(e, t) {
  9806. if (this.runtime.isDomFree) {
  9807. e.set_string("");
  9808. return
  9809. }
  9810. var n = RegExp("[?&]" + t + "=([^&]*)").exec(window.location.search);
  9811. if (n) e.set_string(decodeURIComponent(n[1].replace(/\+/g, " ")));
  9812. else e.set_string("")
  9813. };
  9814. Exps.prototype.Bandwidth = function(e) {
  9815. var t = navigator["connection"] || navigator["mozConnection"] || navigator["webkitConnection"];
  9816. if (!t) e.set_float(Number.POSITIVE_INFINITY);
  9817. else e.set_float(t["bandwidth"])
  9818. };
  9819. Exps.prototype.BatteryLevel = function(e) {
  9820. var t = navigator["battery"] || navigator["mozBattery"] || navigator["webkitBattery"];
  9821. if (!t) e.set_float(1);
  9822. else e.set_float(t["level"])
  9823. };
  9824. Exps.prototype.BatteryTimeLeft = function(e) {
  9825. var t = navigator["battery"] || navigator["mozBattery"] || navigator["webkitBattery"];
  9826. if (!t) e.set_float(Number.POSITIVE_INFINITY);
  9827. else e.set_float(t["dischargingTime"])
  9828. };
  9829. Exps.prototype.ExecJS = function(ret, js_) {
  9830. if (!eval) {
  9831. ret.set_any(0);
  9832. return
  9833. }
  9834. var result = eval(js_);
  9835. if (typeof result === "number") ret.set_any(result);
  9836. else if (typeof result === "string") ret.set_any(result);
  9837. else if (typeof result === "boolean") ret.set_any(result ? 1 : 0);
  9838. else ret.set_any(0)
  9839. };
  9840. Exps.prototype.ScreenWidth = function(e) {
  9841. e.set_int(screen.width)
  9842. };
  9843. Exps.prototype.ScreenHeight = function(e) {
  9844. e.set_int(screen.height)
  9845. };
  9846. Exps.prototype.DevicePixelRatio = function(e) {
  9847. e.set_float(this.runtime.devicePixelRatio)
  9848. };
  9849. pluginProto.exps = new Exps
  9850. })();
  9851. cr.plugins_.Mouse = function(e) {
  9852. this.runtime = e
  9853. };
  9854. (function() {
  9855. function i() {}
  9856. function s() {}
  9857. function o() {}
  9858. var e = cr.plugins_.Mouse.prototype;
  9859. e.Type = function(e) {
  9860. this.plugin = e;
  9861. this.runtime = e.runtime
  9862. };
  9863. var t = e.Type.prototype;
  9864. t.onCreate = function() {};
  9865. e.Instance = function(e) {
  9866. this.type = e;
  9867. this.runtime = e.runtime;
  9868. this.buttonMap = new Array(4);
  9869. this.mouseXcanvas = 0;
  9870. this.mouseYcanvas = 0;
  9871. this.triggerButton = 0;
  9872. this.triggerType = 0;
  9873. this.triggerDir = 0;
  9874. this.handled = false
  9875. };
  9876. var n = e.Instance.prototype;
  9877. n.onCreate = function() {
  9878. var e = this;
  9879. if (!this.runtime.isDomFree) {
  9880. jQuery(document).mousemove(function(t) {
  9881. e.onMouseMove(t)
  9882. });
  9883. jQuery(document).mousedown(function(t) {
  9884. e.onMouseDown(t)
  9885. });
  9886. jQuery(document).mouseup(function(t) {
  9887. e.onMouseUp(t)
  9888. });
  9889. jQuery(document).dblclick(function(t) {
  9890. e.onDoubleClick(t)
  9891. });
  9892. var t = function(t) {
  9893. e.onWheel(t)
  9894. };
  9895. document.addEventListener("mousewheel", t, false);
  9896. document.addEventListener("DOMMouseScroll", t, false)
  9897. }
  9898. };
  9899. var r = {
  9900. left: 0,
  9901. top: 0
  9902. };
  9903. n.onMouseMove = function(e) {
  9904. var t = this.runtime.isDomFree ? r : jQuery(this.runtime.canvas).offset();
  9905. this.mouseXcanvas = e.pageX - t.left;
  9906. this.mouseYcanvas = e.pageY - t.top
  9907. };
  9908. n.mouseInGame = function() {
  9909. if (this.runtime.fullscreen_mode > 0) return true;
  9910. return this.mouseXcanvas >= 0 && this.mouseYcanvas >= 0 && this.mouseXcanvas < this.runtime.width && this.mouseYcanvas < this.runtime.height
  9911. };
  9912. n.onMouseDown = function(e) {
  9913. if (!this.mouseInGame()) return;
  9914. if (this.runtime.had_a_click) e.preventDefault();
  9915. this.buttonMap[e.which] = true;
  9916. this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnAnyClick, this);
  9917. this.triggerButton = e.which - 1;
  9918. this.triggerType = 0;
  9919. this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnClick, this);
  9920. this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, this)
  9921. };
  9922. n.onMouseUp = function(e) {
  9923. if (!this.buttonMap[e.which]) return;
  9924. if (this.runtime.had_a_click) e.preventDefault();
  9925. this.runtime.had_a_click = true;
  9926. this.buttonMap[e.which] = false;
  9927. this.triggerButton = e.which - 1;
  9928. this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnRelease, this)
  9929. };
  9930. n.onDoubleClick = function(e) {
  9931. if (!this.mouseInGame()) return;
  9932. e.preventDefault();
  9933. this.triggerButton = e.which - 1;
  9934. this.triggerType = 1;
  9935. this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnClick, this);
  9936. this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, this)
  9937. };
  9938. n.onWheel = function(e) {
  9939. var t = e.wheelDelta ? e.wheelDelta : e.detail ? -e.detail : 0;
  9940. this.triggerDir = t < 0 ? 0 : 1;
  9941. this.handled = false;
  9942. this.runtime.trigger(cr.plugins_.Mouse.prototype.cnds.OnWheel, this);
  9943. if (this.handled) e.preventDefault()
  9944. };
  9945. i.prototype.OnClick = function(e, t) {
  9946. return e === this.triggerButton && t === this.triggerType
  9947. };
  9948. i.prototype.OnAnyClick = function() {
  9949. return true
  9950. };
  9951. i.prototype.IsButtonDown = function(e) {
  9952. return this.buttonMap[e + 1]
  9953. };
  9954. i.prototype.OnRelease = function(e) {
  9955. return e === this.triggerButton
  9956. };
  9957. i.prototype.IsOverObject = function(e) {
  9958. var t = this.runtime.getCurrentCondition();
  9959. var n = this.mouseXcanvas;
  9960. var r = this.mouseYcanvas;
  9961. return cr.xor(this.runtime.testAndSelectCanvasPointOverlap(e, n, r, t.inverted), t.inverted)
  9962. };
  9963. i.prototype.OnObjectClicked = function(e, t, n) {
  9964. if (e !== this.triggerButton || t !== this.triggerType) return false;
  9965. return this.runtime.testAndSelectCanvasPointOverlap(n, this.mouseXcanvas, this.mouseYcanvas, false)
  9966. };
  9967. i.prototype.OnWheel = function(e) {
  9968. this.handled = true;
  9969. return e === this.triggerDir
  9970. };
  9971. e.cnds = new i;
  9972. s.prototype.SetCursor = function(e) {
  9973. var t = ["auto", "pointer", "text", "crosshair", "move", "help", "wait", "none"][e];
  9974. if (this.runtime.canvas && this.runtime.canvas.style) this.runtime.canvas.style.cursor = t
  9975. };
  9976. s.prototype.SetCursorSprite = function(e) {
  9977. if (this.runtime.isDomFree || this.runtime.isMobile || !e) return;
  9978. var t = e.getFirstPicked();
  9979. if (!t || !t.curFrame) return;
  9980. var n = t.curFrame;
  9981. var r = n.getDataUri();
  9982. var i = "url(" + r + ") " + Math.round(n.hotspotX * n.width) + " " + Math.round(n.hotspotY * n.height) + ", auto";
  9983. jQuery(this.runtime.canvas).css("cursor", i)
  9984. };
  9985. e.acts = new s;
  9986. o.prototype.X = function(e, t) {
  9987. var n, r, i, s, o;
  9988. if (cr.is_undefined(t)) {
  9989. n = this.runtime.getLayerByNumber(0);
  9990. r = n.scale;
  9991. i = n.zoomRate;
  9992. s = n.parallaxX;
  9993. o = n.angle;
  9994. n.scale = this.runtime.running_layout.scale;
  9995. n.zoomRate = 1;
  9996. n.parallaxX = 1;
  9997. n.angle = this.runtime.running_layout.angle;
  9998. e.set_float(n.canvasToLayer(this.mouseXcanvas, this.mouseYcanvas, true));
  9999. n.scale = r;
  10000. n.zoomRate = i;
  10001. n.parallaxX = s;
  10002. n.angle = o
  10003. } else {
  10004. if (cr.is_number(t)) n = this.runtime.getLayerByNumber(t);
  10005. else n = this.runtime.getLayerByName(t); if (n) e.set_float(n.canvasToLayer(this.mouseXcanvas, this.mouseYcanvas, true));
  10006. else e.set_float(0)
  10007. }
  10008. };
  10009. o.prototype.Y = function(e, t) {
  10010. var n, r, i, s, o;
  10011. if (cr.is_undefined(t)) {
  10012. n = this.runtime.getLayerByNumber(0);
  10013. r = n.scale;
  10014. i = n.zoomRate;
  10015. s = n.parallaxY;
  10016. o = n.angle;
  10017. n.scale = this.runtime.running_layout.scale;
  10018. n.zoomRate = 1;
  10019. n.parallaxY = 1;
  10020. n.angle = this.runtime.running_layout.angle;
  10021. e.set_float(n.canvasToLayer(this.mouseXcanvas, this.mouseYcanvas, false));
  10022. n.scale = r;
  10023. n.zoomRate = i;
  10024. n.parallaxY = s;
  10025. n.angle = o
  10026. } else {
  10027. if (cr.is_number(t)) n = this.runtime.getLayerByNumber(t);
  10028. else n = this.runtime.getLayerByName(t); if (n) e.set_float(n.canvasToLayer(this.mouseXcanvas, this.mouseYcanvas, false));
  10029. else e.set_float(0)
  10030. }
  10031. };
  10032. o.prototype.AbsoluteX = function(e) {
  10033. e.set_float(this.mouseXcanvas)
  10034. };
  10035. o.prototype.AbsoluteY = function(e) {
  10036. e.set_float(this.mouseYcanvas)
  10037. };
  10038. e.exps = new o
  10039. })();
  10040. cr.plugins_.Particles = function(e) {
  10041. this.runtime = e
  10042. };
  10043. (function() {
  10044. function n(e) {
  10045. this.owner = e;
  10046. this.active = false;
  10047. this.x = 0;
  10048. this.y = 0;
  10049. this.speed = 0;
  10050. this.angle = 0;
  10051. this.opacity = 1;
  10052. this.grow = 0;
  10053. this.size = 0;
  10054. this.gs = 0;
  10055. this.age = 0;
  10056. cr.seal(this)
  10057. }
  10058. function s() {}
  10059. function o() {}
  10060. function u() {}
  10061. var e = cr.plugins_.Particles.prototype;
  10062. e.Type = function(e) {
  10063. this.plugin = e;
  10064. this.runtime = e.runtime
  10065. };
  10066. var t = e.Type.prototype;
  10067. t.onCreate = function() {
  10068. if (this.is_family) return;
  10069. this.texture_img = new Image;
  10070. this.texture_img["idtkLoadDisposed"] = true;
  10071. this.texture_img.src = this.texture_file;
  10072. this.texture_img.cr_filesize = this.texture_filesize;
  10073. this.webGL_texture = null;
  10074. this.runtime.wait_for_textures.push(this.texture_img)
  10075. };
  10076. t.onLostWebGLContext = function() {
  10077. if (this.is_family) return;
  10078. this.webGL_texture = null
  10079. };
  10080. t.onRestoreWebGLContext = function() {
  10081. if (this.is_family || !this.instances.length) return;
  10082. if (!this.webGL_texture) {
  10083. this.webGL_texture = this.runtime.glwrap.loadTexture(this.texture_img, true, this.runtime.linearSampling, this.texture_pixelformat)
  10084. }
  10085. };
  10086. t.loadTextures = function() {
  10087. if (this.is_family || this.webGL_texture || !this.runtime.glwrap) return;
  10088. this.webGL_texture = this.runtime.glwrap.loadTexture(this.texture_img, true, this.runtime.linearSampling, this.texture_pixelformat)
  10089. };
  10090. t.unloadTextures = function() {
  10091. if (this.is_family || this.instances.length || !this.webGL_texture) return;
  10092. this.runtime.glwrap.deleteTexture(this.webGL_texture);
  10093. this.webGL_texture = null
  10094. };
  10095. t.preloadCanvas2D = function(e) {
  10096. e.drawImage(this.texture_img, 0, 0)
  10097. };
  10098. n.prototype.init = function() {
  10099. var e = this.owner;
  10100. this.x = e.x - e.xrandom / 2 + Math.random() * e.xrandom;
  10101. this.y = e.y - e.yrandom / 2 + Math.random() * e.yrandom;
  10102. this.speed = e.initspeed - e.speedrandom / 2 + Math.random() * e.speedrandom;
  10103. this.angle = e.angle - e.spraycone / 2 + Math.random() * e.spraycone;
  10104. this.opacity = e.initopacity;
  10105. this.size = e.initsize - e.sizerandom / 2 + Math.random() * e.sizerandom;
  10106. this.grow = e.growrate - e.growrandom / 2 + Math.random() * e.growrandom;
  10107. this.gs = 0;
  10108. this.age = 0
  10109. };
  10110. n.prototype.tick = function(e) {
  10111. var t = this.owner;
  10112. this.x += Math.cos(this.angle) * this.speed * e;
  10113. this.y += Math.sin(this.angle) * this.speed * e;
  10114. this.y += this.gs * e;
  10115. this.speed += t.acc * e;
  10116. this.size += this.grow * e;
  10117. this.gs += t.g * e;
  10118. this.age += e;
  10119. if (this.size < 1) {
  10120. this.active = false;
  10121. return
  10122. }
  10123. if (t.lifeanglerandom !== 0) this.angle += Math.random() * t.lifeanglerandom * e - t.lifeanglerandom * e / 2;
  10124. if (t.lifespeedrandom !== 0) this.speed += Math.random() * t.lifespeedrandom * e - t.lifespeedrandom * e / 2;
  10125. if (t.lifeopacityrandom !== 0) {
  10126. this.opacity += Math.random() * t.lifeopacityrandom * e - t.lifeopacityrandom * e / 2;
  10127. if (this.opacity < 0) this.opacity = 0;
  10128. else if (this.opacity > 1) this.opacity = 1
  10129. }
  10130. if (t.destroymode <= 1 && this.age >= t.timeout) {
  10131. this.active = false
  10132. }
  10133. if (t.destroymode === 2 && this.speed <= 0) {
  10134. this.active = false
  10135. }
  10136. };
  10137. n.prototype.draw = function(e) {
  10138. var t = this.owner.opacity * this.opacity;
  10139. if (t === 0) return;
  10140. if (this.owner.destroymode === 0) t *= 1 - this.age / this.owner.timeout;
  10141. e.globalAlpha = t;
  10142. var n = this.x - this.size / 2;
  10143. var r = this.y - this.size / 2;
  10144. if (this.owner.runtime.pixel_rounding) {
  10145. n = n + .5 | 0;
  10146. r = r + .5 | 0
  10147. }
  10148. e.drawImage(this.owner.type.texture_img, n, r, this.size, this.size)
  10149. };
  10150. n.prototype.drawGL = function(e) {
  10151. var t = this.owner.opacity * this.opacity;
  10152. if (this.owner.destroymode === 0) t *= 1 - this.age / this.owner.timeout;
  10153. var n = this.size;
  10154. var r = n * this.owner.particlescale;
  10155. var i = this.x - n / 2;
  10156. var s = this.y - n / 2;
  10157. if (this.owner.runtime.pixel_rounding) {
  10158. i = i + .5 | 0;
  10159. s = s + .5 | 0
  10160. }
  10161. if (r < 1 || t === 0) return;
  10162. if (r < e.minPointSize || r > e.maxPointSize) {
  10163. e.setOpacity(t);
  10164. e.quad(i, s, i + n, s, i + n, s + n, i, s + n)
  10165. } else e.point(this.x, this.y, r, t)
  10166. };
  10167. n.prototype.left = function() {
  10168. return this.x - this.size / 2
  10169. };
  10170. n.prototype.right = function() {
  10171. return this.x + this.size / 2
  10172. };
  10173. n.prototype.top = function() {
  10174. return this.y - this.size / 2
  10175. };
  10176. n.prototype.bottom = function() {
  10177. return this.y + this.size / 2
  10178. };
  10179. e.Instance = function(e) {
  10180. this.type = e;
  10181. this.runtime = e.runtime
  10182. };
  10183. var r = e.Instance.prototype;
  10184. var i = [];
  10185. r.onCreate = function() {
  10186. var e = this.properties;
  10187. this.rate = e[0];
  10188. this.spraycone = cr.to_radians(e[1]);
  10189. this.spraytype = e[2];
  10190. this.spraying = true;
  10191. this.initspeed = e[3];
  10192. this.initsize = e[4];
  10193. this.initopacity = e[5] / 100;
  10194. this.growrate = e[6];
  10195. this.xrandom = e[7];
  10196. this.yrandom = e[8];
  10197. this.speedrandom = e[9];
  10198. this.sizerandom = e[10];
  10199. this.growrandom = e[11];
  10200. this.acc = e[12];
  10201. this.g = e[13];
  10202. this.lifeanglerandom = e[14];
  10203. this.lifespeedrandom = e[15];
  10204. this.lifeopacityrandom = e[16];
  10205. this.destroymode = e[17];
  10206. this.timeout = e[18];
  10207. this.particleCreateCounter = 0;
  10208. this.particlescale = 1;
  10209. this.particleBoxLeft = this.x;
  10210. this.particleBoxTop = this.y;
  10211. this.particleBoxRight = this.x;
  10212. this.particleBoxBottom = this.y;
  10213. this.add_bbox_changed_callback(function(e) {
  10214. e.bbox.set(e.particleBoxLeft, e.particleBoxTop, e.particleBoxRight, e.particleBoxBottom);
  10215. e.bquad.set_from_rect(e.bbox);
  10216. e.bbox_changed = false
  10217. });
  10218. if (!this.recycled) this.particles = [];
  10219. this.runtime.tickMe(this);
  10220. this.type.loadTextures();
  10221. if (this.spraytype === 1) {
  10222. for (var t = 0; t < this.rate; t++) this.allocateParticle().opacity = 0
  10223. }
  10224. this.first_tick = true
  10225. };
  10226. r.saveToJSON = function() {
  10227. var e = {
  10228. r: this.rate,
  10229. sc: this.spraycone,
  10230. st: this.spraytype,
  10231. s: this.spraying,
  10232. isp: this.initspeed,
  10233. isz: this.initsize,
  10234. io: this.initopacity,
  10235. gr: this.growrate,
  10236. xr: this.xrandom,
  10237. yr: this.yrandom,
  10238. spr: this.speedrandom,
  10239. szr: this.sizerandom,
  10240. grnd: this.growrandom,
  10241. acc: this.acc,
  10242. g: this.g,
  10243. lar: this.lifeanglerandom,
  10244. lsr: this.lifespeedrandom,
  10245. lor: this.lifeopacityrandom,
  10246. dm: this.destroymode,
  10247. to: this.timeout,
  10248. pcc: this.particleCreateCounter,
  10249. ft: this.first_tick,
  10250. p: []
  10251. };
  10252. var t, n, r;
  10253. var i = e["p"];
  10254. for (t = 0, n = this.particles.length; t < n; t++) {
  10255. r = this.particles[t];
  10256. i.push([r.x, r.y, r.speed, r.angle, r.opacity, r.grow, r.size, r.gs, r.age])
  10257. }
  10258. return e
  10259. };
  10260. r.loadFromJSON = function(e) {
  10261. this.rate = e["r"];
  10262. this.spraycone = e["sc"];
  10263. this.spraytype = e["st"];
  10264. this.spraying = e["s"];
  10265. this.initspeed = e["isp"];
  10266. this.initsize = e["isz"];
  10267. this.initopacity = e["io"];
  10268. this.growrate = e["gr"];
  10269. this.xrandom = e["xr"];
  10270. this.yrandom = e["yr"];
  10271. this.speedrandom = e["spr"];
  10272. this.sizerandom = e["szr"];
  10273. this.growrandom = e["grnd"];
  10274. this.acc = e["acc"];
  10275. this.g = e["g"];
  10276. this.lifeanglerandom = e["lar"];
  10277. this.lifespeedrandom = e["lsr"];
  10278. this.lifeopacityrandom = e["lor"];
  10279. this.destroymode = e["dm"];
  10280. this.timeout = e["to"];
  10281. this.particleCreateCounter = e["pcc"];
  10282. this.first_tick = e["ft"];
  10283. i.push.apply(i, this.particles);
  10284. this.particles.length = 0;
  10285. var t, n, r, s;
  10286. var o = e["p"];
  10287. for (t = 0, n = o.length; t < n; t++) {
  10288. r = this.allocateParticle();
  10289. s = o[t];
  10290. r.x = s[0];
  10291. r.y = s[1];
  10292. r.speed = s[2];
  10293. r.angle = s[3];
  10294. r.opacity = s[4];
  10295. r.grow = s[5];
  10296. r.size = s[6];
  10297. r.gs = s[7];
  10298. r.age = s[8]
  10299. }
  10300. };
  10301. r.onDestroy = function() {
  10302. i.push.apply(i, this.particles);
  10303. this.particles.length = 0
  10304. };
  10305. r.allocateParticle = function() {
  10306. var e;
  10307. if (i.length) {
  10308. e = i.pop();
  10309. e.owner = this
  10310. } else e = new n(this);
  10311. this.particles.push(e);
  10312. e.active = true;
  10313. return e
  10314. };
  10315. r.tick = function() {
  10316. var e = this.runtime.getDt(this);
  10317. var t, n, r, s, o;
  10318. if (this.spraytype === 0 && this.spraying) {
  10319. this.particleCreateCounter += e * this.rate;
  10320. s = cr.floor(this.particleCreateCounter);
  10321. this.particleCreateCounter -= s;
  10322. for (t = 0; t < s; t++) {
  10323. r = this.allocateParticle();
  10324. r.init()
  10325. }
  10326. }
  10327. this.particleBoxLeft = this.x;
  10328. this.particleBoxTop = this.y;
  10329. this.particleBoxRight = this.x;
  10330. this.particleBoxBottom = this.y;
  10331. for (t = 0, o = 0, n = this.particles.length; t < n; t++) {
  10332. r = this.particles[t];
  10333. this.particles[o] = r;
  10334. this.runtime.redraw = true;
  10335. if (this.spraytype === 1 && this.first_tick) r.init();
  10336. r.tick(e);
  10337. if (!r.active) {
  10338. i.push(r);
  10339. continue
  10340. }
  10341. if (r.left() < this.particleBoxLeft) this.particleBoxLeft = r.left();
  10342. if (r.right() > this.particleBoxRight) this.particleBoxRight = r.right();
  10343. if (r.top() < this.particleBoxTop) this.particleBoxTop = r.top();
  10344. if (r.bottom() > this.particleBoxBottom) this.particleBoxBottom = r.bottom();
  10345. o++
  10346. }
  10347. this.particles.length = o;
  10348. this.set_bbox_changed();
  10349. this.first_tick = false;
  10350. if (this.spraytype === 1 && this.particles.length === 0) this.runtime.DestroyInstance(this)
  10351. };
  10352. r.draw = function(e) {
  10353. var t, n, r, i = this.layer;
  10354. for (t = 0, n = this.particles.length; t < n; t++) {
  10355. r = this.particles[t];
  10356. if (r.right() >= i.viewLeft && r.bottom() >= i.viewTop && r.left() <= i.viewRight && r.top() <= i.viewBottom) {
  10357. r.draw(e)
  10358. }
  10359. }
  10360. };
  10361. r.drawGL = function(e) {
  10362. this.particlescale = this.layer.getScale();
  10363. e.setTexture(this.type.webGL_texture);
  10364. var t, n, r, i = this.layer;
  10365. for (t = 0, n = this.particles.length; t < n; t++) {
  10366. r = this.particles[t];
  10367. if (r.right() >= i.viewLeft && r.bottom() >= i.viewTop && r.left() <= i.viewRight && r.top() <= i.viewBottom) {
  10368. r.drawGL(e)
  10369. }
  10370. }
  10371. };
  10372. s.prototype.IsSpraying = function() {
  10373. return this.spraying
  10374. };
  10375. e.cnds = new s;
  10376. o.prototype.SetSpraying = function(e) {
  10377. this.spraying = e !== 0
  10378. };
  10379. o.prototype.SetEffect = function(e) {
  10380. this.compositeOp = cr.effectToCompositeOp(e);
  10381. cr.setGLBlend(this, e, this.runtime.gl);
  10382. this.runtime.redraw = true
  10383. };
  10384. o.prototype.SetRate = function(e) {
  10385. this.rate = e;
  10386. var t, n;
  10387. if (this.spraytype === 1 && this.first_tick) {
  10388. if (e < this.particles.length) {
  10389. t = this.particles.length - e;
  10390. for (n = 0; n < t; n++) i.push(this.particles.pop())
  10391. } else if (e > this.particles.length) {
  10392. t = e - this.particles.length;
  10393. for (n = 0; n < t; n++) this.allocateParticle().opacity = 0
  10394. }
  10395. }
  10396. };
  10397. o.prototype.SetSprayCone = function(e) {
  10398. this.spraycone = cr.to_radians(e)
  10399. };
  10400. o.prototype.SetInitSpeed = function(e) {
  10401. this.initspeed = e
  10402. };
  10403. o.prototype.SetInitSize = function(e) {
  10404. this.initsize = e
  10405. };
  10406. o.prototype.SetInitOpacity = function(e) {
  10407. this.initopacity = e / 100
  10408. };
  10409. o.prototype.SetGrowRate = function(e) {
  10410. this.growrate = e
  10411. };
  10412. o.prototype.SetXRandomiser = function(e) {
  10413. this.xrandom = e
  10414. };
  10415. o.prototype.SetYRandomiser = function(e) {
  10416. this.yrandom = e
  10417. };
  10418. o.prototype.SetSpeedRandomiser = function(e) {
  10419. this.speedrandom = e
  10420. };
  10421. o.prototype.SetSizeRandomiser = function(e) {
  10422. this.sizerandom = e
  10423. };
  10424. o.prototype.SetGrowRateRandomiser = function(e) {
  10425. this.growrandom = e
  10426. };
  10427. o.prototype.SetParticleAcc = function(e) {
  10428. this.acc = e
  10429. };
  10430. o.prototype.SetGravity = function(e) {
  10431. this.g = e
  10432. };
  10433. o.prototype.SetAngleRandomiser = function(e) {
  10434. this.lifeanglerandom = e
  10435. };
  10436. o.prototype.SetSpeedRandomiser = function(e) {
  10437. this.lifespeedrandom = e
  10438. };
  10439. o.prototype.SetOpacityRandomiser = function(e) {
  10440. this.lifeopacityrandom = e
  10441. };
  10442. o.prototype.SetTimeout = function(e) {
  10443. this.timeout = e
  10444. };
  10445. e.acts = new o;
  10446. u.prototype.ParticleCount = function(e) {
  10447. e.set_int(this.particles.length)
  10448. };
  10449. u.prototype.Rate = function(e) {
  10450. e.set_float(this.rate)
  10451. };
  10452. u.prototype.SprayCone = function(e) {
  10453. e.set_float(cr.to_degrees(this.spraycone))
  10454. };
  10455. u.prototype.InitSpeed = function(e) {
  10456. e.set_float(this.initspeed)
  10457. };
  10458. u.prototype.InitSize = function(e) {
  10459. e.set_float(this.initsize)
  10460. };
  10461. u.prototype.InitOpacity = function(e) {
  10462. e.set_float(this.initopacity * 100)
  10463. };
  10464. u.prototype.InitGrowRate = function(e) {
  10465. e.set_float(this.growrate)
  10466. };
  10467. u.prototype.XRandom = function(e) {
  10468. e.set_float(this.xrandom)
  10469. };
  10470. u.prototype.YRandom = function(e) {
  10471. e.set_float(this.yrandom)
  10472. };
  10473. u.prototype.InitSpeedRandom = function(e) {
  10474. e.set_float(this.speedrandom)
  10475. };
  10476. u.prototype.InitSizeRandom = function(e) {
  10477. e.set_float(this.sizerandom)
  10478. };
  10479. u.prototype.InitGrowRandom = function(e) {
  10480. e.set_float(this.growrandom)
  10481. };
  10482. u.prototype.ParticleAcceleration = function(e) {
  10483. e.set_float(this.acc)
  10484. };
  10485. u.prototype.Gravity = function(e) {
  10486. e.set_float(this.g)
  10487. };
  10488. u.prototype.ParticleAngleRandom = function(e) {
  10489. e.set_float(this.lifeanglerandom)
  10490. };
  10491. u.prototype.ParticleSpeedRandom = function(e) {
  10492. e.set_float(this.lifespeedrandom)
  10493. };
  10494. u.prototype.ParticleOpacityRandom = function(e) {
  10495. e.set_float(this.lifeopacityrandom)
  10496. };
  10497. u.prototype.Timeout = function(e) {
  10498. e.set_float(this.timeout)
  10499. };
  10500. e.exps = new u
  10501. })();
  10502. cr.plugins_.Softgames = function(e) {
  10503. this.runtime = e
  10504. };
  10505. (function() {
  10506. function r() {}
  10507. function i() {}
  10508. function s() {}
  10509. var e = cr.plugins_.Softgames.prototype;
  10510. e.Type = function(e) {
  10511. this.plugin = e;
  10512. this.runtime = e.runtime
  10513. };
  10514. var t = e.Type.prototype;
  10515. t.onCreate = function() {};
  10516. e.Instance = function(e) {
  10517. this.type = e;
  10518. this.runtime = e.runtime
  10519. };
  10520. var n = e.Instance.prototype;
  10521. n.onCreate = function() {};
  10522. n.onDestroy = function() {};
  10523. n.saveToJSON = function() {
  10524. return {}
  10525. };
  10526. n.loadFromJSON = function(e) {};
  10527. n.draw = function(e) {};
  10528. n.drawGL = function(e) {};
  10529. r.prototype.IsSuspended = function() {
  10530. return this.runtime.isSuspended
  10531. };
  10532. e.cnds = new r;
  10533. i.prototype.ConnectAPI = function() {};
  10534. i.prototype.startGame = function() {
  10535. SG_Hooks.start()
  10536. };
  10537. i.prototype.levelUp = function() {
  10538. 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";
  10539. 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";
  10540. SG_Hooks.levelUp(window.c2_level, window.c2_score);
  10541. if (window.c2_score > getHighScore()) localStorage["high_score"] = window.c2_score
  10542. };
  10543. i.prototype.gameOver = function() {
  10544. 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";
  10545. 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";
  10546. if (window.c2_score > getHighScore()) {
  10547. localStorage[gameID + "high_score"] = window.c2_score; /*updateShare(window.c2_score);Play68.setRankingScoreDesc(window.c2_score)*/
  10548. }
  10549. };
  10550. i.prototype.setOrientationHandler = function() {
  10551. 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";
  10552. SG_Hooks.setOrientationHandler(window.c2_orientationHandler)
  10553. };
  10554. i.prototype.setOrientationHandler = function() {
  10555. 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";
  10556. SG_Hooks.setResizeHandler(window.c2_resizeHandler)
  10557. };
  10558. e.acts = new i;
  10559. s.prototype.getLanguage = function(e) {
  10560. var t = Object.prototype.toString.call(window.c2_supportedLanguages).toLowerCase() == "[object array]";
  10561. 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']";
  10562. e.set_string(SG_Hooks.getLanguage(window.c2_supportedLanguages))
  10563. };
  10564. e.exps = new s
  10565. })();
  10566. cr.plugins_.Sprite = function(e) {
  10567. this.runtime = e
  10568. };
  10569. (function() {
  10570. function n() {
  10571. if (this.datauri.length === 0) {
  10572. var e = document.createElement("canvas");
  10573. e.width = this.width;
  10574. e.height = this.height;
  10575. var t = e.getContext("2d");
  10576. if (this.spritesheeted) {
  10577. t.drawImage(this.texture_img, this.offx, this.offy, this.width, this.height, 0, 0, this.width, this.height)
  10578. } else {
  10579. t.drawImage(this.texture_img, 0, 0, this.width, this.height)
  10580. }
  10581. this.datauri = e.toDataURL("image/png")
  10582. }
  10583. return this.datauri
  10584. }
  10585. function s() {}
  10586. function u() {
  10587. if (o.length) return o.pop();
  10588. else return [0, 0]
  10589. }
  10590. function a(e) {
  10591. e[0] = 0;
  10592. e[1] = 0;
  10593. o.push(e)
  10594. }
  10595. function f(e, t, n) {
  10596. var r = u();
  10597. r[0] = t.uid;
  10598. r[1] = n.uid;
  10599. e.push(r)
  10600. }
  10601. function l(e, t, n) {
  10602. var r = t.uid;
  10603. var i = n.uid;
  10604. var s, o = 0,
  10605. u, f;
  10606. for (s = 0, u = e.length; s < u; s++) {
  10607. f = e[s];
  10608. if (!(f[0] === r && f[1] === i || f[0] === i && f[1] === r)) {
  10609. e[o][0] = e[s][0];
  10610. e[o][1] = e[s][1];
  10611. o++
  10612. }
  10613. }
  10614. for (s = o; s < u; s++) a(e[s]);
  10615. e.length = o
  10616. }
  10617. function c(e, t) {
  10618. var n, r = 0,
  10619. i, s, o = t.uid;
  10620. for (n = 0, i = e.length; n < i; n++) {
  10621. s = e[n];
  10622. if (s[0] !== o && s[1] !== o) {
  10623. e[r][0] = e[n][0];
  10624. e[r][1] = e[n][1];
  10625. r++
  10626. }
  10627. }
  10628. for (n = r; n < i; n++) a(e[n]);
  10629. e.length = r
  10630. }
  10631. function h(e, t, n) {
  10632. var r = t.uid;
  10633. var i = n.uid;
  10634. var s, o, u;
  10635. for (s = 0, o = e.length; s < o; s++) {
  10636. u = e[s];
  10637. if (u[0] === r && u[1] === i || u[0] === i && u[1] === r) return true
  10638. }
  10639. return false
  10640. }
  10641. function m(e, t, n) {
  10642. if (!e) return false;
  10643. var r = t !== 0 || n !== 0;
  10644. var i, s, o = false,
  10645. u, a, f;
  10646. var l = this.runtime.getCurrentCondition();
  10647. var c = l.type;
  10648. var h = l.inverted;
  10649. var m = e.getCurrentSol();
  10650. var g = this.runtime.getCurrentEventStack().current_event.orblock;
  10651. var y;
  10652. if (m.select_all) y = m.type.instances;
  10653. else if (g) y = m.else_instances;
  10654. else y = m.instances;
  10655. p = e;
  10656. v = c !== e && !h;
  10657. if (r) {
  10658. i = this.x;
  10659. s = this.y;
  10660. this.x += t;
  10661. this.y += n;
  10662. this.set_bbox_changed()
  10663. }
  10664. for (u = 0, a = y.length; u < a; u++) {
  10665. f = y[u];
  10666. if (this.runtime.testOverlap(this, f)) {
  10667. o = true;
  10668. if (h) break;
  10669. if (c !== e) d.add(f)
  10670. }
  10671. }
  10672. if (r) {
  10673. this.x = i;
  10674. this.y = s;
  10675. this.set_bbox_changed()
  10676. }
  10677. return o
  10678. }
  10679. function g() {}
  10680. function y() {}
  10681. var e = cr.plugins_.Sprite.prototype;
  10682. e.Type = function(e) {
  10683. this.plugin = e;
  10684. this.runtime = e.runtime
  10685. };
  10686. var t = e.Type.prototype;
  10687. t.onCreate = function() {
  10688. if (this.is_family) return;
  10689. var e, t, r, i;
  10690. var s, o, u, a, f, l;
  10691. this.all_frames = [];
  10692. this.has_loaded_textures = false;
  10693. for (e = 0, t = this.animations.length; e < t; e++) {
  10694. s = this.animations[e];
  10695. u = {};
  10696. u.name = s[0];
  10697. u.speed = s[1];
  10698. u.loop = s[2];
  10699. u.repeatcount = s[3];
  10700. u.repeatto = s[4];
  10701. u.pingpong = s[5];
  10702. u.sid = s[6];
  10703. u.frames = [];
  10704. for (r = 0, i = s[7].length; r < i; r++) {
  10705. o = s[7][r];
  10706. a = {};
  10707. a.texture_file = o[0];
  10708. a.texture_filesize = o[1];
  10709. a.offx = o[2];
  10710. a.offy = o[3];
  10711. a.width = o[4];
  10712. a.height = o[5];
  10713. a.duration = o[6];
  10714. a.hotspotX = o[7];
  10715. a.hotspotY = o[8];
  10716. a.image_points = o[9];
  10717. a.poly_pts = o[10];
  10718. a.pixelformat = o[11];
  10719. a.spritesheeted = a.width !== 0;
  10720. a.datauri = "";
  10721. a.getDataUri = n;
  10722. l = {};
  10723. l.left = 0;
  10724. l.top = 0;
  10725. l.right = 1;
  10726. l.bottom = 1;
  10727. a.sheetTex = l;
  10728. a.webGL_texture = null;
  10729. f = this.runtime.findWaitingTexture(o[0]);
  10730. if (f) {
  10731. a.texture_img = f
  10732. } else {
  10733. a.texture_img = new Image;
  10734. a.texture_img["idtkLoadDisposed"] = true;
  10735. a.texture_img.src = o[0];
  10736. a.texture_img.cr_src = o[0];
  10737. a.texture_img.cr_filesize = o[1];
  10738. a.texture_img.c2webGL_texture = null;
  10739. this.runtime.wait_for_textures.push(a.texture_img)
  10740. }
  10741. cr.seal(a);
  10742. u.frames.push(a);
  10743. this.all_frames.push(a)
  10744. }
  10745. cr.seal(u);
  10746. this.animations[e] = u
  10747. }
  10748. };
  10749. t.updateAllCurrentTexture = function() {
  10750. var e, t, n;
  10751. for (e = 0, t = this.instances.length; e < t; e++) {
  10752. n = this.instances[e];
  10753. n.curWebGLTexture = n.curFrame.webGL_texture
  10754. }
  10755. };
  10756. t.onLostWebGLContext = function() {
  10757. if (this.is_family) return;
  10758. var e, t, n;
  10759. for (e = 0, t = this.all_frames.length; e < t; ++e) {
  10760. n = this.all_frames[e];
  10761. n.texture_img.c2webGL_texture = null;
  10762. n.webGL_texture = null
  10763. }
  10764. };
  10765. t.onRestoreWebGLContext = function() {
  10766. if (this.is_family || !this.instances.length) return;
  10767. var e, t, n;
  10768. for (e = 0, t = this.all_frames.length; e < t; ++e) {
  10769. n = this.all_frames[e];
  10770. n.webGL_texture = this.runtime.glwrap.loadTexture(n.texture_img, false, this.runtime.linearSampling, n.pixelformat)
  10771. }
  10772. this.updateAllCurrentTexture()
  10773. };
  10774. t.loadTextures = function() {
  10775. if (this.is_family || this.has_loaded_textures || !this.runtime.glwrap) 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.webGL_texture = this.runtime.glwrap.loadTexture(n.texture_img, false, this.runtime.linearSampling, n.pixelformat)
  10780. }
  10781. this.has_loaded_textures = true
  10782. };
  10783. t.unloadTextures = function() {
  10784. if (this.is_family || this.instances.length || !this.has_loaded_textures) 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. this.runtime.glwrap.deleteTexture(n.webGL_texture)
  10789. }
  10790. this.has_loaded_textures = false
  10791. };
  10792. var r = [];
  10793. t.preloadCanvas2D = function(e) {
  10794. var t, n, i;
  10795. r.length = 0;
  10796. for (t = 0, n = this.all_frames.length; t < n; ++t) {
  10797. i = this.all_frames[t].texture_img;
  10798. if (r.indexOf(i) !== -1) continue;
  10799. e.drawImage(i, 0, 0);
  10800. r.push(i)
  10801. }
  10802. };
  10803. e.Instance = function(e) {
  10804. this.type = e;
  10805. this.runtime = e.runtime;
  10806. var t = this.type.animations[0].frames[0].poly_pts;
  10807. if (this.recycled) this.collision_poly.set_pts(t);
  10808. else this.collision_poly = new cr.CollisionPoly(t)
  10809. };
  10810. var i = e.Instance.prototype;
  10811. i.onCreate = function() {
  10812. this.visible = this.properties[0] === 0;
  10813. this.isTicking = false;
  10814. this.inAnimTrigger = false;
  10815. this.collisionsEnabled = this.properties[3] !== 0;
  10816. if (!(this.type.animations.length === 1 && this.type.animations[0].frames.length === 1) && this.type.animations[0].speed !== 0) {
  10817. this.runtime.tickMe(this);
  10818. this.isTicking = true
  10819. }
  10820. this.cur_animation = this.getAnimationByName(this.properties[1]) || this.type.animations[0];
  10821. this.cur_frame = this.properties[2];
  10822. if (this.cur_frame < 0) this.cur_frame = 0;
  10823. if (this.cur_frame >= this.cur_animation.frames.length) this.cur_frame = this.cur_animation.frames.length - 1;
  10824. var e = this.cur_animation.frames[this.cur_frame];
  10825. this.collision_poly.set_pts(e.poly_pts);
  10826. this.hotspotX = e.hotspotX;
  10827. this.hotspotY = e.hotspotY;
  10828. this.cur_anim_speed = this.cur_animation.speed;
  10829. if (this.recycled) this.animTimer.reset();
  10830. else this.animTimer = new cr.KahanAdder;
  10831. this.frameStart = this.getNowTime();
  10832. this.animPlaying = true;
  10833. this.animRepeats = 0;
  10834. this.animForwards = true;
  10835. this.animTriggerName = "";
  10836. this.changeAnimName = "";
  10837. this.changeAnimFrom = 0;
  10838. this.changeAnimFrame = -1;
  10839. this.type.loadTextures();
  10840. var t, n, r, i;
  10841. var s, o, u, a;
  10842. for (t = 0, n = this.type.animations.length; t < n; t++) {
  10843. s = this.type.animations[t];
  10844. for (r = 0, i = s.frames.length; r < i; r++) {
  10845. o = s.frames[r];
  10846. if (o.width === 0) {
  10847. o.width = o.texture_img.width;
  10848. o.height = o.texture_img.height
  10849. }
  10850. if (o.spritesheeted) {
  10851. a = o.texture_img;
  10852. u = o.sheetTex;
  10853. u.left = o.offx / a.width;
  10854. u.top = o.offy / a.height;
  10855. u.right = (o.offx + o.width) / a.width;
  10856. u.bottom = (o.offy + o.height) / a.height;
  10857. if (o.offx === 0 && o.offy === 0 && o.width === a.width && o.height === a.height) {
  10858. o.spritesheeted = false
  10859. }
  10860. }
  10861. }
  10862. }
  10863. this.curFrame = this.cur_animation.frames[this.cur_frame];
  10864. this.curWebGLTexture = this.curFrame.webGL_texture
  10865. };
  10866. i.saveToJSON = function() {
  10867. var e = {
  10868. a: this.cur_animation.sid,
  10869. f: this.cur_frame,
  10870. cas: this.cur_anim_speed,
  10871. fs: this.frameStart,
  10872. ar: this.animRepeats,
  10873. at: this.animTimer.sum
  10874. };
  10875. if (!this.animPlaying) e["ap"] = this.animPlaying;
  10876. if (!this.animForwards) e["af"] = this.animForwards;
  10877. return e
  10878. };
  10879. i.loadFromJSON = function(e) {
  10880. var t = this.getAnimationBySid(e["a"]);
  10881. if (t) this.cur_animation = t;
  10882. this.cur_frame = e["f"];
  10883. if (this.cur_frame < 0) this.cur_frame = 0;
  10884. if (this.cur_frame >= this.cur_animation.frames.length) this.cur_frame = this.cur_animation.frames.length - 1;
  10885. this.cur_anim_speed = e["cas"];
  10886. this.frameStart = e["fs"];
  10887. this.animRepeats = e["ar"];
  10888. this.animTimer.reset();
  10889. this.animTimer.sum = e["at"];
  10890. this.animPlaying = e.hasOwnProperty("ap") ? e["ap"] : true;
  10891. this.animForwards = e.hasOwnProperty("af") ? e["af"] : true;
  10892. this.curFrame = this.cur_animation.frames[this.cur_frame];
  10893. this.curWebGLTexture = this.curFrame.webGL_texture;
  10894. this.collision_poly.set_pts(this.curFrame.poly_pts);
  10895. this.hotspotX = this.curFrame.hotspotX;
  10896. this.hotspotY = this.curFrame.hotspotY
  10897. };
  10898. i.animationFinish = function(e) {
  10899. this.cur_frame = e ? 0 : this.cur_animation.frames.length - 1;
  10900. this.animPlaying = false;
  10901. this.animTriggerName = this.cur_animation.name;
  10902. this.inAnimTrigger = true;
  10903. this.runtime.trigger(cr.plugins_.Sprite.prototype.cnds.OnAnyAnimFinished, this);
  10904. this.runtime.trigger(cr.plugins_.Sprite.prototype.cnds.OnAnimFinished, this);
  10905. this.inAnimTrigger = false;
  10906. this.animRepeats = 0
  10907. };
  10908. i.getNowTime = function() {
  10909. return this.animTimer.sum
  10910. };
  10911. i.tick = function() {
  10912. this.animTimer.add(this.runtime.getDt(this));
  10913. if (this.changeAnimName.length) this.doChangeAnim();
  10914. if (this.changeAnimFrame >= 0) this.doChangeAnimFrame();
  10915. var e = this.getNowTime();
  10916. var t = this.cur_animation;
  10917. var n = t.frames[this.cur_frame];
  10918. var r;
  10919. var i = n.duration / this.cur_anim_speed;
  10920. if (this.animPlaying && e >= this.frameStart + i) {
  10921. if (this.animForwards) {
  10922. this.cur_frame++
  10923. } else {
  10924. this.cur_frame--
  10925. }
  10926. this.frameStart += i;
  10927. if (this.cur_frame >= t.frames.length) {
  10928. if (t.pingpong) {
  10929. this.animForwards = false;
  10930. this.cur_frame = t.frames.length - 2
  10931. } else if (t.loop) {
  10932. this.cur_frame = t.repeatto
  10933. } else {
  10934. this.animRepeats++;
  10935. if (this.animRepeats >= t.repeatcount) {
  10936. this.animationFinish(false)
  10937. } else {
  10938. this.cur_frame = t.repeatto
  10939. }
  10940. }
  10941. }
  10942. if (this.cur_frame < 0) {
  10943. if (t.pingpong) {
  10944. this.cur_frame = 1;
  10945. this.animForwards = true;
  10946. if (!t.loop) {
  10947. this.animRepeats++;
  10948. if (this.animRepeats >= t.repeatcount) {
  10949. this.animationFinish(true)
  10950. }
  10951. }
  10952. } else {
  10953. if (t.loop) {
  10954. this.cur_frame = t.repeatto
  10955. } else {
  10956. this.animRepeats++;
  10957. if (this.animRepeats >= t.repeatcount) {
  10958. this.animationFinish(true)
  10959. } else {
  10960. this.cur_frame = t.repeatto
  10961. }
  10962. }
  10963. }
  10964. }
  10965. if (this.cur_frame < 0) this.cur_frame = 0;
  10966. else if (this.cur_frame >= t.frames.length) this.cur_frame = t.frames.length - 1;
  10967. if (e > this.frameStart + t.frames[this.cur_frame].duration / this.cur_anim_speed) {
  10968. this.frameStart = e
  10969. }
  10970. r = t.frames[this.cur_frame];
  10971. this.OnFrameChanged(n, r);
  10972. this.runtime.redraw = true
  10973. }
  10974. };
  10975. i.getAnimationByName = function(e) {
  10976. var t, n, r;
  10977. for (t = 0, n = this.type.animations.length; t < n; t++) {
  10978. r = this.type.animations[t];
  10979. if (cr.equals_nocase(r.name, e)) return r
  10980. }
  10981. return null
  10982. };
  10983. i.getAnimationBySid = function(e) {
  10984. var t, n, r;
  10985. for (t = 0, n = this.type.animations.length; t < n; t++) {
  10986. r = this.type.animations[t];
  10987. if (r.sid === e) return r
  10988. }
  10989. return null
  10990. };
  10991. i.doChangeAnim = function() {
  10992. var e = this.cur_animation.frames[this.cur_frame];
  10993. var t = this.getAnimationByName(this.changeAnimName);
  10994. this.changeAnimName = "";
  10995. if (!t) return;
  10996. if (cr.equals_nocase(t.name, this.cur_animation.name) && this.animPlaying) return;
  10997. this.cur_animation = t;
  10998. this.cur_anim_speed = t.speed;
  10999. if (this.cur_frame < 0) this.cur_frame = 0;
  11000. if (this.cur_frame >= this.cur_animation.frames.length) this.cur_frame = this.cur_animation.frames.length - 1;
  11001. if (this.changeAnimFrom === 1) this.cur_frame = 0;
  11002. this.animPlaying = true;
  11003. this.frameStart = this.getNowTime();
  11004. this.animForwards = true;
  11005. this.OnFrameChanged(e, this.cur_animation.frames[this.cur_frame]);
  11006. this.runtime.redraw = true
  11007. };
  11008. i.doChangeAnimFrame = function() {
  11009. var e = this.cur_animation.frames[this.cur_frame];
  11010. var t = this.cur_frame;
  11011. this.cur_frame = cr.floor(this.changeAnimFrame);
  11012. if (this.cur_frame < 0) this.cur_frame = 0;
  11013. if (this.cur_frame >= this.cur_animation.frames.length) this.cur_frame = this.cur_animation.frames.length - 1;
  11014. if (t !== this.cur_frame) {
  11015. this.OnFrameChanged(e, this.cur_animation.frames[this.cur_frame]);
  11016. this.frameStart = this.getNowTime();
  11017. this.runtime.redraw = true
  11018. }
  11019. this.changeAnimFrame = -1
  11020. };
  11021. i.OnFrameChanged = function(e, t) {
  11022. var n = e.width;
  11023. var r = e.height;
  11024. var i = t.width;
  11025. var s = t.height;
  11026. if (n != i) this.width *= i / n;
  11027. if (r != s) this.height *= s / r;
  11028. this.hotspotX = t.hotspotX;
  11029. this.hotspotY = t.hotspotY;
  11030. this.collision_poly.set_pts(t.poly_pts);
  11031. this.set_bbox_changed();
  11032. this.curFrame = t;
  11033. this.curWebGLTexture = t.webGL_texture;
  11034. var o, u, a;
  11035. for (o = 0, u = this.behavior_insts.length; o < u; o++) {
  11036. a = this.behavior_insts[o];
  11037. if (a.onSpriteFrameChanged) a.onSpriteFrameChanged(e, t)
  11038. }
  11039. this.runtime.trigger(cr.plugins_.Sprite.prototype.cnds.OnFrameChanged, this)
  11040. };
  11041. i.draw = function(e) {
  11042. e.globalAlpha = this.opacity;
  11043. var t = this.curFrame;
  11044. var n = t.spritesheeted;
  11045. var r = t.texture_img;
  11046. var i = this.x;
  11047. var s = this.y;
  11048. var o = this.width;
  11049. var u = this.height;
  11050. if (this.angle === 0 && o >= 0 && u >= 0) {
  11051. i -= this.hotspotX * o;
  11052. s -= this.hotspotY * u;
  11053. if (this.runtime.pixel_rounding) {
  11054. i = i + .5 | 0;
  11055. s = s + .5 | 0
  11056. }
  11057. if (n) {
  11058. e.drawImage(r, t.offx, t.offy, t.width, t.height, i, s, o, u)
  11059. } else {
  11060. e.drawImage(r, i, s, o, u)
  11061. }
  11062. } else {
  11063. if (this.runtime.pixel_rounding) {
  11064. i = i + .5 | 0;
  11065. s = s + .5 | 0
  11066. }
  11067. e.save();
  11068. var a = o > 0 ? 1 : -1;
  11069. var f = u > 0 ? 1 : -1;
  11070. e.translate(i, s);
  11071. if (a !== 1 || f !== 1) e.scale(a, f);
  11072. e.rotate(this.angle * a * f);
  11073. var l = 0 - this.hotspotX * cr.abs(o);
  11074. var c = 0 - this.hotspotY * cr.abs(u);
  11075. if (n) {
  11076. e.drawImage(r, t.offx, t.offy, t.width, t.height, l, c, cr.abs(o), cr.abs(u))
  11077. } else {
  11078. e.drawImage(r, l, c, cr.abs(o), cr.abs(u))
  11079. }
  11080. e.restore()
  11081. }
  11082. };
  11083. i.drawGL = function(e) {
  11084. e.setTexture(this.curWebGLTexture);
  11085. e.setOpacity(this.opacity);
  11086. var t = this.curFrame;
  11087. var n = this.bquad;
  11088. if (this.runtime.pixel_rounding) {
  11089. var r = (this.x + .5 | 0) - this.x;
  11090. var i = (this.y + .5 | 0) - this.y;
  11091. 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);
  11092. 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)
  11093. } else {
  11094. if (t.spritesheeted) e.quadTex(n.tlx, n.tly, n.trx, n.try_, n.brx, n.bry, n.blx, n.bly, t.sheetTex);
  11095. else e.quad(n.tlx, n.tly, n.trx, n.try_, n.brx, n.bry, n.blx, n.bly)
  11096. }
  11097. };
  11098. i.getImagePointIndexByName = function(e) {
  11099. var t = this.curFrame;
  11100. var n, r;
  11101. for (n = 0, r = t.image_points.length; n < r; n++) {
  11102. if (cr.equals_nocase(e, t.image_points[n][0])) return n
  11103. }
  11104. return -1
  11105. };
  11106. i.getImagePoint = function(e, t) {
  11107. var n = this.curFrame;
  11108. var r = n.image_points;
  11109. var i;
  11110. if (cr.is_string(e)) i = this.getImagePointIndexByName(e);
  11111. else i = e - 1;
  11112. i = cr.floor(i);
  11113. if (i < 0 || i >= r.length) return t ? this.x : this.y;
  11114. var s = (r[i][1] - n.hotspotX) * this.width;
  11115. var o = r[i][2];
  11116. o = (o - n.hotspotY) * this.height;
  11117. var u = Math.cos(this.angle);
  11118. var a = Math.sin(this.angle);
  11119. var f = s * u - o * a;
  11120. o = o * u + s * a;
  11121. s = f;
  11122. s += this.x;
  11123. o += this.y;
  11124. return t ? s : o
  11125. };
  11126. var o = [];
  11127. s.prototype.OnCollision = function(e) {
  11128. if (!e) return false;
  11129. var t = this.runtime;
  11130. var n = t.getCurrentCondition();
  11131. var r = n.type;
  11132. if (!n.extra.collmemory) {
  11133. n.extra.collmemory = [];
  11134. t.addDestroyCallback(function(e) {
  11135. return function(t) {
  11136. c(e, t)
  11137. }
  11138. }(n.extra.collmemory))
  11139. }
  11140. var i = r.getCurrentSol();
  11141. var s = e.getCurrentSol();
  11142. var o = i.getObjects();
  11143. var u = s.getObjects();
  11144. var a, p, d, v;
  11145. var m, g;
  11146. var y = t.getCurrentEventStack().current_event;
  11147. var b = y.orblock;
  11148. for (a = 0; a < o.length; a++) {
  11149. p = o[a];
  11150. for (d = 0; d < u.length; d++) {
  11151. v = u[d];
  11152. if (t.testOverlap(p, v) || t.checkRegisteredCollision(p, v)) {
  11153. if (!h(n.extra.collmemory, p, v)) {
  11154. f(n.extra.collmemory, p, v);
  11155. t.pushCopySol(y.solModifiers);
  11156. m = r.getCurrentSol();
  11157. g = e.getCurrentSol();
  11158. m.select_all = false;
  11159. g.select_all = false;
  11160. if (r === e) {
  11161. m.instances.length = 2;
  11162. m.instances[0] = p;
  11163. m.instances[1] = v;
  11164. r.applySolToContainer()
  11165. } else {
  11166. m.instances.length = 1;
  11167. g.instances.length = 1;
  11168. m.instances[0] = p;
  11169. g.instances[0] = v;
  11170. r.applySolToContainer();
  11171. e.applySolToContainer()
  11172. }
  11173. y.retrigger();
  11174. t.popSol(y.solModifiers)
  11175. }
  11176. } else {
  11177. l(n.extra.collmemory, p, v)
  11178. }
  11179. }
  11180. }
  11181. return false
  11182. };
  11183. var p = null;
  11184. var d = new cr.ObjectSet;
  11185. var v = false;
  11186. t.finish = function(e) {
  11187. if (!v) return;
  11188. if (e) {
  11189. var t = this.runtime.getCurrentEventStack().current_event.orblock;
  11190. var n = p.getCurrentSol();
  11191. var r = d.valuesRef();
  11192. var i, s, o;
  11193. if (n.select_all) {
  11194. n.select_all = false;
  11195. n.instances.length = r.length;
  11196. for (i = 0, s = r.length; i < s; i++) {
  11197. n.instances[i] = r[i]
  11198. }
  11199. if (t) {
  11200. n.else_instances.length = 0;
  11201. for (i = 0, s = p.instances.length; i < s; i++) {
  11202. o = p.instances[i];
  11203. if (!d.contains(o)) n.else_instances.push(o)
  11204. }
  11205. }
  11206. } else {
  11207. var u = n.instances.length;
  11208. n.instances.length = u + r.length;
  11209. for (i = 0, s = r.length; i < s; i++) {
  11210. n.instances[u + i] = r[i];
  11211. if (t) cr.arrayFindRemove(n.else_instances, r[i])
  11212. }
  11213. }
  11214. p.applySolToContainer()
  11215. }
  11216. d.clear();
  11217. v = false
  11218. };
  11219. s.prototype.IsOverlapping = function(e) {
  11220. return m.call(this, e, 0, 0)
  11221. };
  11222. s.prototype.IsOverlappingOffset = function(e, t, n) {
  11223. return m.call(this, e, t, n)
  11224. };
  11225. s.prototype.IsAnimPlaying = function(e) {
  11226. if (this.changeAnimName.length) return cr.equals_nocase(this.changeAnimName, e);
  11227. else return cr.equals_nocase(this.cur_animation.name, e)
  11228. };
  11229. s.prototype.CompareFrame = function(e, t) {
  11230. return cr.do_cmp(this.cur_frame, e, t)
  11231. };
  11232. s.prototype.OnAnimFinished = function(e) {
  11233. return cr.equals_nocase(this.animTriggerName, e)
  11234. };
  11235. s.prototype.OnAnyAnimFinished = function() {
  11236. return true
  11237. };
  11238. s.prototype.OnFrameChanged = function() {
  11239. return true
  11240. };
  11241. s.prototype.IsMirrored = function() {
  11242. return this.width < 0
  11243. };
  11244. s.prototype.IsFlipped = function() {
  11245. return this.height < 0
  11246. };
  11247. s.prototype.OnURLLoaded = function() {
  11248. return true
  11249. };
  11250. s.prototype.IsCollisionEnabled = function() {
  11251. return this.collisionsEnabled
  11252. };
  11253. e.cnds = new s;
  11254. g.prototype.Spawn = function(e, t, n) {
  11255. if (!e || !t) return;
  11256. var r = this.runtime.createInstance(e, t, this.getImagePoint(n, true), this.getImagePoint(n, false));
  11257. if (!r) return;
  11258. if (typeof r.angle !== "undefined") {
  11259. r.angle = this.angle;
  11260. r.set_bbox_changed()
  11261. }
  11262. this.runtime.isInOnDestroy++;
  11263. var i, s, o;
  11264. this.runtime.trigger(Object.getPrototypeOf(e.plugin).cnds.OnCreated, r);
  11265. if (r.is_contained) {
  11266. for (i = 0, s = r.siblings.length; i < s; i++) {
  11267. o = r.siblings[i];
  11268. this.runtime.trigger(Object.getPrototypeOf(o.type.plugin).cnds.OnCreated, o)
  11269. }
  11270. }
  11271. this.runtime.isInOnDestroy--;
  11272. var u = this.runtime.getCurrentAction();
  11273. var a = false;
  11274. if (cr.is_undefined(u.extra.Spawn_LastExec) || u.extra.Spawn_LastExec < this.runtime.execcount) {
  11275. a = true;
  11276. u.extra.Spawn_LastExec = this.runtime.execcount
  11277. }
  11278. var f;
  11279. if (e != this.type) {
  11280. f = e.getCurrentSol();
  11281. f.select_all = false;
  11282. if (a) {
  11283. f.instances.length = 1;
  11284. f.instances[0] = r
  11285. } else f.instances.push(r); if (r.is_contained) {
  11286. for (i = 0, s = r.siblings.length; i < s; i++) {
  11287. o = r.siblings[i];
  11288. f = o.type.getCurrentSol();
  11289. f.select_all = false;
  11290. if (a) {
  11291. f.instances.length = 1;
  11292. f.instances[0] = o
  11293. } else f.instances.push(o)
  11294. }
  11295. }
  11296. }
  11297. };
  11298. g.prototype.SetEffect = function(e) {
  11299. this.compositeOp = cr.effectToCompositeOp(e);
  11300. cr.setGLBlend(this, e, this.runtime.gl);
  11301. this.runtime.redraw = true
  11302. };
  11303. g.prototype.StopAnim = function() {
  11304. this.animPlaying = false
  11305. };
  11306. g.prototype.StartAnim = function(e) {
  11307. this.animPlaying = true;
  11308. this.frameStart = this.getNowTime();
  11309. if (e === 1 && this.cur_frame !== 0) {
  11310. this.changeAnimFrame = 0;
  11311. if (!this.inAnimTrigger) this.doChangeAnimFrame()
  11312. }
  11313. if (!this.isTicking) {
  11314. this.runtime.tickMe(this);
  11315. this.isTicking = true
  11316. }
  11317. };
  11318. g.prototype.SetAnim = function(e, t) {
  11319. this.changeAnimName = e;
  11320. this.changeAnimFrom = t;
  11321. if (!this.isTicking) {
  11322. this.runtime.tickMe(this);
  11323. this.isTicking = true
  11324. }
  11325. if (!this.inAnimTrigger) this.doChangeAnim()
  11326. };
  11327. g.prototype.SetAnimFrame = function(e) {
  11328. this.changeAnimFrame = e;
  11329. if (!this.isTicking) {
  11330. this.runtime.tickMe(this);
  11331. this.isTicking = true
  11332. }
  11333. if (!this.inAnimTrigger) this.doChangeAnimFrame()
  11334. };
  11335. g.prototype.SetAnimSpeed = function(e) {
  11336. this.cur_anim_speed = cr.abs(e);
  11337. this.animForwards = e >= 0;
  11338. if (!this.isTicking) {
  11339. this.runtime.tickMe(this);
  11340. this.isTicking = true
  11341. }
  11342. };
  11343. g.prototype.SetMirrored = function(e) {
  11344. var t = cr.abs(this.width) * (e === 0 ? -1 : 1);
  11345. if (this.width === t) return;
  11346. this.width = t;
  11347. this.set_bbox_changed()
  11348. };
  11349. g.prototype.SetFlipped = function(e) {
  11350. var t = cr.abs(this.height) * (e === 0 ? -1 : 1);
  11351. if (this.height === t) return;
  11352. this.height = t;
  11353. this.set_bbox_changed()
  11354. };
  11355. g.prototype.SetScale = function(e) {
  11356. var t = this.curFrame;
  11357. var n = this.width < 0 ? -1 : 1;
  11358. var r = this.height < 0 ? -1 : 1;
  11359. var i = t.width * e * n;
  11360. var s = t.height * e * r;
  11361. if (this.width !== i || this.height !== s) {
  11362. this.width = i;
  11363. this.height = s;
  11364. this.set_bbox_changed()
  11365. }
  11366. };
  11367. g.prototype.LoadURL = function(e, t) {
  11368. var n = new Image;
  11369. var r = this;
  11370. var i = this.curFrame;
  11371. n.onload = function() {
  11372. if (i.texture_img.src === n.src) {
  11373. if (r.runtime.glwrap && r.curFrame === i) r.curWebGLTexture = i.webGL_texture;
  11374. r.runtime.redraw = true;
  11375. r.runtime.trigger(cr.plugins_.Sprite.prototype.cnds.OnURLLoaded, r);
  11376. return
  11377. }
  11378. i.texture_img = n;
  11379. i.offx = 0;
  11380. i.offy = 0;
  11381. i.width = n.width;
  11382. i.height = n.height;
  11383. i.spritesheeted = false;
  11384. i.datauri = "";
  11385. if (r.runtime.glwrap) {
  11386. if (i.webGL_texture) r.runtime.glwrap.deleteTexture(i.webGL_texture);
  11387. i.webGL_texture = r.runtime.glwrap.loadTexture(n, false, r.runtime.linearSampling);
  11388. if (r.curFrame === i) r.curWebGLTexture = i.webGL_texture;
  11389. r.type.updateAllCurrentTexture()
  11390. }
  11391. if (t === 0) {
  11392. r.width = n.width;
  11393. r.height = n.height;
  11394. r.set_bbox_changed()
  11395. }
  11396. r.runtime.redraw = true;
  11397. r.runtime.trigger(cr.plugins_.Sprite.prototype.cnds.OnURLLoaded, r)
  11398. };
  11399. if (e.substr(0, 5) !== "data:") n.crossOrigin = "anonymous";
  11400. n.src = e
  11401. };
  11402. g.prototype.SetCollisions = function(e) {
  11403. this.collisionsEnabled = e !== 0
  11404. };
  11405. e.acts = new g;
  11406. y.prototype.AnimationFrame = function(e) {
  11407. e.set_int(this.cur_frame)
  11408. };
  11409. y.prototype.AnimationFrameCount = function(e) {
  11410. e.set_int(this.cur_animation.frames.length)
  11411. };
  11412. y.prototype.AnimationName = function(e) {
  11413. e.set_string(this.cur_animation.name)
  11414. };
  11415. y.prototype.AnimationSpeed = function(e) {
  11416. e.set_float(this.cur_anim_speed)
  11417. };
  11418. y.prototype.ImagePointX = function(e, t) {
  11419. e.set_float(this.getImagePoint(t, true))
  11420. };
  11421. y.prototype.ImagePointY = function(e, t) {
  11422. e.set_float(this.getImagePoint(t, false))
  11423. };
  11424. y.prototype.ImagePointCount = function(e) {
  11425. e.set_int(this.curFrame.image_points.length)
  11426. };
  11427. y.prototype.ImageWidth = function(e) {
  11428. e.set_float(this.curFrame.width)
  11429. };
  11430. y.prototype.ImageHeight = function(e) {
  11431. e.set_float(this.curFrame.height)
  11432. };
  11433. e.exps = new y
  11434. })();
  11435. cr.plugins_.Spritefont2 = function(e) {
  11436. this.runtime = e
  11437. };
  11438. (function() {
  11439. function r(e) {
  11440. return e.replace(/\s\s*$/, "")
  11441. }
  11442. function s(e, t) {
  11443. if (e.length) return e.pop();
  11444. else return new t
  11445. }
  11446. function o(e, t) {
  11447. if (e.length < i) {
  11448. e.push(t)
  11449. }
  11450. }
  11451. function u(e, t, n) {
  11452. if (n) {
  11453. var r, i;
  11454. for (r = 0, i = t.length; r < i; r++) {
  11455. o(e, t[r])
  11456. }
  11457. t.length = 0
  11458. } else {
  11459. var s;
  11460. for (s in t) {
  11461. if (Object.prototype.hasOwnProperty.call(t, s)) {
  11462. o(e, t[s]);
  11463. delete t[s]
  11464. }
  11465. }
  11466. }
  11467. }
  11468. function a(e, t, n) {
  11469. var i = e.lines;
  11470. var s;
  11471. n = r(n);
  11472. if (t >= i.length) i.push(l());
  11473. s = i[t];
  11474. s.text = n;
  11475. s.width = e.measureWidth(n);
  11476. e.textWidth = cr.max(e.textWidth, s.width)
  11477. }
  11478. function l() {
  11479. return s(f, Object)
  11480. }
  11481. function c(e) {
  11482. o(f, e)
  11483. }
  11484. function h(e) {
  11485. u(f, e, true)
  11486. }
  11487. function p(e, t, n, r, i, o) {
  11488. if (e[t] === undefined) {
  11489. e[t] = s(d, Object)
  11490. }
  11491. e[t].x = n;
  11492. e[t].y = r;
  11493. e[t].w = i;
  11494. e[t].h = o
  11495. }
  11496. function v() {
  11497. return s(d, Object)
  11498. }
  11499. function m(e) {
  11500. u(d, e, false)
  11501. }
  11502. function g(e, t, n, r, i, o) {
  11503. if (e[t] === undefined) {
  11504. e[t] = s(y, cr.rect)
  11505. }
  11506. e[t].left = n;
  11507. e[t].top = r;
  11508. e[t].right = i;
  11509. e[t].bottom = o
  11510. }
  11511. function b() {
  11512. return s(y, cr.rect)
  11513. }
  11514. function w(e) {
  11515. u(y, e, false)
  11516. }
  11517. function T(e, t, n) {
  11518. var r;
  11519. r = e.tlx * t - e.tly * n;
  11520. e.tly = e.tly * t + e.tlx * n;
  11521. e.tlx = r;
  11522. r = e.trx * t - e.try_ * n;
  11523. e.try_ = e.try_ * t + e.trx * n;
  11524. e.trx = r;
  11525. r = e.blx * t - e.bly * n;
  11526. e.bly = e.bly * t + e.blx * n;
  11527. e.blx = r;
  11528. r = e.brx * t - e.bry * n;
  11529. e.bry = e.bry * t + e.brx * n;
  11530. e.brx = r
  11531. }
  11532. function N() {}
  11533. function C() {}
  11534. function k() {}
  11535. var e = cr.plugins_.Spritefont2.prototype;
  11536. e.onCreate = function() {};
  11537. e.Type = function(e) {
  11538. this.plugin = e;
  11539. this.runtime = e.runtime
  11540. };
  11541. var t = e.Type.prototype;
  11542. t.onCreate = function() {
  11543. if (this.is_family) return;
  11544. this.texture_img = new Image;
  11545. this.texture_img["idtkLoadDisposed"] = true;
  11546. this.texture_img.src = this.texture_file;
  11547. this.runtime.wait_for_textures.push(this.texture_img);
  11548. this.webGL_texture = null
  11549. };
  11550. t.onLostWebGLContext = function() {
  11551. if (this.is_family) return;
  11552. this.webGL_texture = null
  11553. };
  11554. t.onRestoreWebGLContext = function() {
  11555. if (this.is_family || !this.instances.length) return;
  11556. if (!this.webGL_texture) {
  11557. this.webGL_texture = this.runtime.glwrap.loadTexture(this.texture_img, false, this.runtime.linearSampling, this.texture_pixelformat)
  11558. }
  11559. var e, t;
  11560. for (e = 0, t = this.instances.length; e < t; e++) this.instances[e].webGL_texture = this.webGL_texture
  11561. };
  11562. t.unloadTextures = function() {
  11563. if (this.is_family || this.instances.length || !this.webGL_texture) return;
  11564. this.runtime.glwrap.deleteTexture(this.webGL_texture);
  11565. this.webGL_texture = null
  11566. };
  11567. t.preloadCanvas2D = function(e) {
  11568. e.drawImage(this.texture_img, 0, 0)
  11569. };
  11570. e.Instance = function(e) {
  11571. this.type = e;
  11572. this.runtime = e.runtime
  11573. };
  11574. var n = e.Instance.prototype;
  11575. n.onDestroy = function() {
  11576. h(this.lines);
  11577. m(this.clipList);
  11578. w(this.clipUV);
  11579. cr.wipe(this.characterWidthList)
  11580. };
  11581. n.onCreate = function() {
  11582. this.texture_img = this.type.texture_img;
  11583. this.characterWidth = this.properties[0];
  11584. this.characterHeight = this.properties[1];
  11585. this.characterSet = this.properties[2];
  11586. this.text = this.properties[3];
  11587. this.characterScale = this.properties[4];
  11588. this.visible = this.properties[5] === 0;
  11589. this.halign = this.properties[6] / 2;
  11590. this.valign = this.properties[7] / 2;
  11591. this.wrapbyword = this.properties[9] === 0;
  11592. this.characterSpacing = this.properties[10];
  11593. this.lineHeight = this.properties[11];
  11594. this.textWidth = 0;
  11595. this.textHeight = 0;
  11596. if (this.recycled) {
  11597. this.lines.length = 0;
  11598. cr.wipe(this.clipList);
  11599. cr.wipe(this.clipUV);
  11600. cr.wipe(this.characterWidthList)
  11601. } else {
  11602. this.lines = [];
  11603. this.clipList = {};
  11604. this.clipUV = {};
  11605. this.characterWidthList = {}
  11606. }
  11607. this.text_changed = true;
  11608. this.lastwrapwidth = this.width;
  11609. if (this.runtime.glwrap) {
  11610. if (!this.type.webGL_texture) {
  11611. this.type.webGL_texture = this.runtime.glwrap.loadTexture(this.type.texture_img, false, this.runtime.linearSampling, this.type.texture_pixelformat)
  11612. }
  11613. this.webGL_texture = this.type.webGL_texture
  11614. }
  11615. this.SplitSheet()
  11616. };
  11617. n.saveToJSON = function() {
  11618. var e = {
  11619. t: this.text,
  11620. csc: this.characterScale,
  11621. csp: this.characterSpacing,
  11622. lh: this.lineHeight,
  11623. tw: this.textWidth,
  11624. th: this.textHeight,
  11625. lrt: this.last_render_tick,
  11626. cw: {}
  11627. };
  11628. for (var t in this.characterWidthList) e["cw"][t] = this.characterWidthList[t];
  11629. return e
  11630. };
  11631. n.loadFromJSON = function(e) {
  11632. this.text = e["t"];
  11633. this.characterScale = e["csc"];
  11634. this.characterSpacing = e["csp"];
  11635. this.lineHeight = e["lh"];
  11636. this.textWidth = e["tw"];
  11637. this.textHeight = e["th"];
  11638. this.last_render_tick = e["lrt"];
  11639. for (var t in e["cw"]) this.characterWidthList[t] = e["cw"][t];
  11640. this.text_changed = true;
  11641. this.lastwrapwidth = this.width
  11642. };
  11643. var i = 1e3;
  11644. var f = [];
  11645. var d = [];
  11646. var y = [];
  11647. n.SplitSheet = function() {
  11648. var e = this.texture_img;
  11649. var t = e.width;
  11650. var n = e.height;
  11651. var r = this.characterWidth;
  11652. var i = this.characterHeight;
  11653. var s = r / t;
  11654. var o = i / n;
  11655. var u = this.characterSet;
  11656. var a = Math.floor(t / r);
  11657. var f = Math.floor(n / i);
  11658. for (var l = 0; l < u.length; l++) {
  11659. if (l >= a * f) break;
  11660. var c = l % a;
  11661. var h = Math.floor(l / a);
  11662. var d = u.charAt(l);
  11663. if (this.runtime.glwrap) {
  11664. g(this.clipUV, d, c * s, h * o, (c + 1) * s, (h + 1) * o)
  11665. } else {
  11666. p(this.clipList, d, c * r, h * i, r, i)
  11667. }
  11668. }
  11669. };
  11670. var E = [];
  11671. e.TokeniseWords = function(e) {
  11672. E.length = 0;
  11673. var t = "";
  11674. var n;
  11675. var r = 0;
  11676. while (r < e.length) {
  11677. n = e.charAt(r);
  11678. if (n === "\n") {
  11679. if (t.length) {
  11680. E.push(t);
  11681. t = ""
  11682. }
  11683. E.push("\n");
  11684. ++r
  11685. } else if (n === " " || n === " " || n === "-") {
  11686. do {
  11687. t += e.charAt(r);
  11688. r++
  11689. } while (r < e.length && (e.charAt(r) === " " || e.charAt(r) === " "));
  11690. E.push(t);
  11691. t = ""
  11692. } else if (r < e.length) {
  11693. t += n;
  11694. r++
  11695. }
  11696. }
  11697. if (t.length) E.push(t)
  11698. };
  11699. e.WordWrap = function(e) {
  11700. var t = e.text;
  11701. var n = e.lines;
  11702. if (!t || !t.length) {
  11703. h(n);
  11704. return
  11705. }
  11706. var r = e.width;
  11707. if (r <= 2) {
  11708. h(n);
  11709. return
  11710. }
  11711. var i = e.characterWidth;
  11712. var s = e.characterScale;
  11713. var o = e.characterSpacing;
  11714. if (t.length * (i * s + o) - o <= r && t.indexOf("\n") === -1) {
  11715. var u = e.measureWidth(t);
  11716. if (u <= r) {
  11717. h(n);
  11718. n.push(l());
  11719. n[0].text = t;
  11720. n[0].width = u;
  11721. e.textWidth = u;
  11722. e.textHeight = e.characterHeight * s + e.lineHeight;
  11723. return
  11724. }
  11725. }
  11726. var a = e.wrapbyword;
  11727. this.WrapText(e);
  11728. e.textHeight = n.length * (e.characterHeight * s + e.lineHeight)
  11729. };
  11730. e.WrapText = function(e) {
  11731. var t = e.wrapbyword;
  11732. var n = e.text;
  11733. var i = e.lines;
  11734. var s = e.width;
  11735. var o;
  11736. if (t) {
  11737. this.TokeniseWords(n);
  11738. o = E
  11739. } else {
  11740. o = n
  11741. }
  11742. var u = "";
  11743. var f;
  11744. var l;
  11745. var h;
  11746. var p = 0;
  11747. var d;
  11748. var v = false;
  11749. for (h = 0; h < o.length; h++) {
  11750. if (o[h] === "\n") {
  11751. if (v === true) {
  11752. v = false
  11753. } else {
  11754. a(e, p, u);
  11755. p++
  11756. }
  11757. u = "";
  11758. continue
  11759. }
  11760. v = false;
  11761. f = u;
  11762. u += o[h];
  11763. l = e.measureWidth(r(u));
  11764. if (l > s) {
  11765. if (f === "") {
  11766. a(e, p, u);
  11767. u = "";
  11768. v = true
  11769. } else {
  11770. a(e, p, f);
  11771. u = o[h]
  11772. }
  11773. p++;
  11774. if (!t && u === " ") u = ""
  11775. }
  11776. }
  11777. if (r(u).length) {
  11778. a(e, p, u);
  11779. p++
  11780. }
  11781. for (h = p; h < i.length; h++) c(i[h]);
  11782. i.length = p
  11783. };
  11784. n.measureWidth = function(e) {
  11785. var t = this.characterSpacing;
  11786. var n = e.length;
  11787. var r = 0;
  11788. for (var i = 0; i < n; i++) {
  11789. r += this.getCharacterWidth(e.charAt(i)) * this.characterScale + t
  11790. }
  11791. r -= r > 0 ? t : 0;
  11792. return r
  11793. };
  11794. n.getCharacterWidth = function(e) {
  11795. var t = this.characterWidthList;
  11796. if (t[e] !== undefined) {
  11797. return t[e]
  11798. } else {
  11799. return this.characterWidth
  11800. }
  11801. };
  11802. n.rebuildText = function() {
  11803. if (this.text_changed || this.width !== this.lastwrapwidth) {
  11804. this.textWidth = 0;
  11805. this.textHeight = 0;
  11806. this.type.plugin.WordWrap(this);
  11807. this.text_changed = false;
  11808. this.lastwrapwidth = this.width
  11809. }
  11810. };
  11811. var S = 1e-5;
  11812. n.draw = function(e, t) {
  11813. var n = this.texture_img;
  11814. if (this.text !== "" && n != null) {
  11815. this.rebuildText();
  11816. if (this.height < this.characterHeight * this.characterScale + this.lineHeight) {
  11817. return
  11818. }
  11819. e.globalAlpha = this.opacity;
  11820. var r = this.x;
  11821. var i = this.y;
  11822. if (this.runtime.pixel_rounding) {
  11823. r = r + .5 | 0;
  11824. i = i + .5 | 0
  11825. }
  11826. e.save();
  11827. e.translate(r, i);
  11828. e.rotate(this.angle);
  11829. var s = this.halign;
  11830. var o = this.valign;
  11831. var u = this.characterScale;
  11832. var a = this.characterHeight * u;
  11833. var f = this.lineHeight;
  11834. var l = this.characterSpacing;
  11835. var c = this.lines;
  11836. var h = this.textHeight;
  11837. var p;
  11838. var d = o * cr.max(0, this.height - h);
  11839. var v = -(this.hotspotX * this.width);
  11840. var m = -(this.hotspotY * this.height);
  11841. m += d;
  11842. var g;
  11843. var y = m;
  11844. for (var b = 0; b < c.length; b++) {
  11845. var w = c[b].text;
  11846. var E = c[b].width;
  11847. p = s * cr.max(0, this.width - E);
  11848. g = v + p;
  11849. y += f;
  11850. for (var x = 0; x < w.length; x++) {
  11851. var T = w.charAt(x);
  11852. var N = this.clipList[T];
  11853. if (g + this.getCharacterWidth(T) * u > this.width + S) {
  11854. break
  11855. }
  11856. if (N !== undefined) {
  11857. 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)
  11858. }
  11859. g += this.getCharacterWidth(T) * u + l
  11860. }
  11861. y += a;
  11862. if (y + a + f > this.height) {
  11863. break
  11864. }
  11865. }
  11866. e.restore()
  11867. }
  11868. };
  11869. var x = new cr.quad;
  11870. n.drawGL = function(e) {
  11871. e.setTexture(this.webGL_texture);
  11872. e.setOpacity(this.opacity);
  11873. if (this.text !== "") {
  11874. this.rebuildText();
  11875. if (this.height < this.characterHeight * this.characterScale + this.lineHeight) {
  11876. return
  11877. }
  11878. this.update_bbox();
  11879. var t = this.bquad;
  11880. var n = 0;
  11881. var r = 0;
  11882. if (this.runtime.pixel_rounding) {
  11883. n = (this.x + .5 | 0) - this.x;
  11884. r = (this.y + .5 | 0) - this.y
  11885. }
  11886. var i = this.angle;
  11887. var s = this.halign;
  11888. var o = this.valign;
  11889. var u = this.characterScale;
  11890. var a = this.characterHeight * u;
  11891. var f = this.lineHeight;
  11892. var l = this.characterSpacing;
  11893. var c = this.lines;
  11894. var h = this.textHeight;
  11895. var p, d;
  11896. if (i !== 0) {
  11897. p = Math.cos(i);
  11898. d = Math.sin(i)
  11899. }
  11900. var v;
  11901. var m = o * cr.max(0, this.height - h);
  11902. var g = t.tlx + n;
  11903. var y = t.tly + r;
  11904. var b;
  11905. var w = m;
  11906. for (var E = 0; E < c.length; E++) {
  11907. var N = c[E].text;
  11908. var C = c[E].width;
  11909. v = s * cr.max(0, this.width - C);
  11910. b = v;
  11911. w += f;
  11912. for (var k = 0; k < N.length; k++) {
  11913. var L = N.charAt(k);
  11914. var A = this.clipUV[L];
  11915. if (b + this.getCharacterWidth(L) * u > this.width + S) {
  11916. break
  11917. }
  11918. if (A !== undefined) {
  11919. var O = this.characterWidth * u;
  11920. var M = this.characterHeight * u;
  11921. x.tlx = b;
  11922. x.tly = w;
  11923. x.trx = b + O;
  11924. x.try_ = w;
  11925. x.blx = b;
  11926. x.bly = w + M;
  11927. x.brx = b + O;
  11928. x.bry = w + M;
  11929. if (i !== 0) {
  11930. T(x, p, d)
  11931. }
  11932. x.offset(g, y);
  11933. e.quadTex(x.tlx, x.tly, x.trx, x.try_, x.brx, x.bry, x.blx, x.bly, A)
  11934. }
  11935. b += this.getCharacterWidth(L) * u + l
  11936. }
  11937. w += a;
  11938. if (w + a + f > this.height) {
  11939. break
  11940. }
  11941. }
  11942. }
  11943. };
  11944. N.prototype.CompareText = function(e, t) {
  11945. if (t) return this.text == e;
  11946. else return cr.equals_nocase(this.text, e)
  11947. };
  11948. e.cnds = new N;
  11949. C.prototype.SetText = function(e) {
  11950. if (e.match(/BEST:/)) {
  11951. e = " " + getHighScore()
  11952. } else if (e.match(/MEJOR:/)) {
  11953. e = "MEJOR:" + getHighScore()
  11954. }
  11955. if (cr.is_number(e) && e < 1e9) e = Math.round(e * 1e10) / 1e10;
  11956. var t = e.toString();
  11957. if (this.text !== t) {
  11958. this.text = t;
  11959. this.text_changed = true;
  11960. this.runtime.redraw = true
  11961. }
  11962. };
  11963. C.prototype.AppendText = function(e) {
  11964. if (cr.is_number(e)) e = Math.round(e * 1e10) / 1e10;
  11965. var t = e.toString();
  11966. if (t) {
  11967. this.text += t;
  11968. this.text_changed = true;
  11969. this.runtime.redraw = true
  11970. }
  11971. };
  11972. C.prototype.SetScale = function(e) {
  11973. if (e !== this.characterScale) {
  11974. this.characterScale = e;
  11975. this.text_changed = true;
  11976. this.runtime.redraw = true
  11977. }
  11978. };
  11979. C.prototype.SetCharacterSpacing = function(e) {
  11980. if (e !== this.CharacterSpacing) {
  11981. this.characterSpacing = e;
  11982. this.text_changed = true;
  11983. this.runtime.redraw = true
  11984. }
  11985. };
  11986. C.prototype.SetLineHeight = function(e) {
  11987. if (e !== this.lineHeight) {
  11988. this.lineHeight = e;
  11989. this.text_changed = true;
  11990. this.runtime.redraw = true
  11991. }
  11992. };
  11993. n.SetCharWidth = function(e, t) {
  11994. var n = parseInt(t, 10);
  11995. if (this.characterWidthList[e] !== n) {
  11996. this.characterWidthList[e] = n;
  11997. this.text_changed = true;
  11998. this.runtime.redraw = true
  11999. }
  12000. };
  12001. C.prototype.SetCharacterWidth = function(e, t) {
  12002. if (e !== "") {
  12003. for (var n = 0; n < e.length; n++) {
  12004. this.SetCharWidth(e.charAt(n), t)
  12005. }
  12006. }
  12007. };
  12008. C.prototype.SetEffect = function(e) {
  12009. this.compositeOp = cr.effectToCompositeOp(e);
  12010. cr.setGLBlend(this, e, this.runtime.gl);
  12011. this.runtime.redraw = true
  12012. };
  12013. e.acts = new C;
  12014. k.prototype.CharacterWidth = function(e, t) {
  12015. e.set_int(this.getCharacterWidth(t))
  12016. };
  12017. k.prototype.CharacterHeight = function(e) {
  12018. e.set_int(this.characterHeight)
  12019. };
  12020. k.prototype.CharacterScale = function(e) {
  12021. e.set_float(this.characterScale)
  12022. };
  12023. k.prototype.CharacterSpacing = function(e) {
  12024. e.set_int(this.characterSpacing)
  12025. };
  12026. k.prototype.LineHeight = function(e) {
  12027. e.set_int(this.lineHeight)
  12028. };
  12029. k.prototype.Text = function(e) {
  12030. e.set_string(this.text)
  12031. };
  12032. k.prototype.TextWidth = function(e) {
  12033. this.rebuildText();
  12034. e.set_float(this.textWidth)
  12035. };
  12036. k.prototype.TextHeight = function(e) {
  12037. this.rebuildText();
  12038. e.set_float(this.textHeight)
  12039. };
  12040. e.exps = new k
  12041. })();
  12042. cr.plugins_.Text = function(e) {
  12043. this.runtime = e
  12044. };
  12045. (function() {
  12046. function o() {
  12047. if (s.length) return s.pop();
  12048. else return {}
  12049. }
  12050. function u(e) {
  12051. s.push(e)
  12052. }
  12053. function a(e) {
  12054. var t, n;
  12055. for (t = 0, n = e.length; t < n; t++) {
  12056. u(e[t])
  12057. }
  12058. e.length = 0
  12059. }
  12060. function f() {}
  12061. function l() {}
  12062. function c() {}
  12063. var e = cr.plugins_.Text.prototype;
  12064. e.onCreate = function() {
  12065. e.acts.SetWidth = function(e) {
  12066. if (this.width !== e) {
  12067. this.width = e;
  12068. this.text_changed = true;
  12069. this.set_bbox_changed()
  12070. }
  12071. }
  12072. };
  12073. e.Type = function(e) {
  12074. this.plugin = e;
  12075. this.runtime = e.runtime
  12076. };
  12077. var t = e.Type.prototype;
  12078. t.onCreate = function() {};
  12079. t.onLostWebGLContext = function() {
  12080. if (this.is_family) return;
  12081. var e, t, n;
  12082. for (e = 0, t = this.instances.length; e < t; e++) {
  12083. n = this.instances[e];
  12084. n.mycanvas = null;
  12085. n.myctx = null;
  12086. n.mytex = null
  12087. }
  12088. };
  12089. e.Instance = function(e) {
  12090. this.type = e;
  12091. this.runtime = e.runtime;
  12092. if (this.recycled) this.lines.length = 0;
  12093. else this.lines = [];
  12094. this.text_changed = true
  12095. };
  12096. var n = e.Instance.prototype;
  12097. var r = {};
  12098. n.onCreate = function() {
  12099. this.text = this.properties[0];
  12100. this.visible = this.properties[1] === 0;
  12101. this.font = this.properties[2];
  12102. this.color = this.properties[3];
  12103. this.halign = this.properties[4];
  12104. this.valign = this.properties[5];
  12105. this.wrapbyword = this.properties[7] === 0;
  12106. this.lastwidth = this.width;
  12107. this.lastwrapwidth = this.width;
  12108. this.lastheight = this.height;
  12109. this.line_height_offset = this.properties[8];
  12110. this.facename = "";
  12111. this.fontstyle = "";
  12112. this.ptSize = 0;
  12113. this.textWidth = 0;
  12114. this.textHeight = 0;
  12115. this.parseFont();
  12116. this.mycanvas = null;
  12117. this.myctx = null;
  12118. this.mytex = null;
  12119. this.need_text_redraw = false;
  12120. this.last_render_tick = this.runtime.tickcount;
  12121. if (this.recycled) this.rcTex.set(0, 0, 1, 1);
  12122. else this.rcTex = new cr.rect(0, 0, 1, 1); if (this.runtime.glwrap) this.runtime.tickMe(this);
  12123. };
  12124. n.parseFont = function() {
  12125. var e = this.font.split(" ");
  12126. var t;
  12127. for (t = 0; t < e.length; t++) {
  12128. if (e[t].substr(e[t].length - 2, 2) === "pt") {
  12129. this.ptSize = parseInt(e[t].substr(0, e[t].length - 2));
  12130. this.pxHeight = Math.ceil(this.ptSize / 72 * 96) + 4;
  12131. if (t > 0) this.fontstyle = e[t - 1];
  12132. this.facename = e[t + 1];
  12133. for (t = t + 2; t < e.length; t++) this.facename += " " + e[t];
  12134. break
  12135. }
  12136. }
  12137. };
  12138. n.saveToJSON = function() {
  12139. return {
  12140. t: this.text,
  12141. f: this.font,
  12142. c: this.color,
  12143. ha: this.halign,
  12144. va: this.valign,
  12145. wr: this.wrapbyword,
  12146. lho: this.line_height_offset,
  12147. fn: this.facename,
  12148. fs: this.fontstyle,
  12149. ps: this.ptSize,
  12150. pxh: this.pxHeight,
  12151. tw: this.textWidth,
  12152. th: this.textHeight,
  12153. lrt: this.last_render_tick
  12154. }
  12155. };
  12156. n.loadFromJSON = function(e) {
  12157. this.text = e["t"];
  12158. this.font = e["f"];
  12159. this.color = e["c"];
  12160. this.halign = e["ha"];
  12161. this.valign = e["va"];
  12162. this.wrapbyword = e["wr"];
  12163. this.line_height_offset = e["lho"];
  12164. this.facename = e["fn"];
  12165. this.fontstyle = e["fs"];
  12166. this.ptSize = e["ps"];
  12167. this.pxHeight = e["pxh"];
  12168. this.textWidth = e["tw"];
  12169. this.textHeight = e["th"];
  12170. this.last_render_tick = e["lrt"];
  12171. this.text_changed = true;
  12172. this.lastwidth = this.width;
  12173. this.lastwrapwidth = this.width;
  12174. this.lastheight = this.height
  12175. };
  12176. n.tick = function() {
  12177. if (this.runtime.glwrap && this.mytex && this.runtime.tickcount - this.last_render_tick >= 300) {
  12178. var e = this.layer;
  12179. this.update_bbox();
  12180. var t = this.bbox;
  12181. if (t.right < e.viewLeft || t.bottom < e.viewTop || t.left > e.viewRight || t.top > e.viewBottom) {
  12182. this.runtime.glwrap.deleteTexture(this.mytex);
  12183. this.mytex = null;
  12184. this.myctx = null;
  12185. this.mycanvas = null
  12186. }
  12187. }
  12188. };
  12189. n.onDestroy = function() {
  12190. this.myctx = null;
  12191. this.mycanvas = null;
  12192. if (this.runtime.glwrap && this.mytex) this.runtime.glwrap.deleteTexture(this.mytex);
  12193. this.mytex = null
  12194. };
  12195. n.updateFont = function() {
  12196. this.font = this.fontstyle + " " + this.ptSize.toString() + "pt " + this.facename;
  12197. this.text_changed = true;
  12198. this.runtime.redraw = true
  12199. };
  12200. n.draw = function(e, t) {
  12201. e.font = this.font;
  12202. e.textBaseline = "top";
  12203. e.fillStyle = this.color;
  12204. e.globalAlpha = t ? 1 : this.opacity;
  12205. var n = 1;
  12206. if (t) {
  12207. n = this.layer.getScale();
  12208. e.save();
  12209. e.scale(n, n)
  12210. }
  12211. if (this.text_changed || this.width !== this.lastwrapwidth) {
  12212. this.type.plugin.WordWrap(this.text, this.lines, e, this.width, this.wrapbyword);
  12213. this.text_changed = false;
  12214. this.lastwrapwidth = this.width
  12215. }
  12216. this.update_bbox();
  12217. var r = t ? 0 : this.bquad.tlx;
  12218. var i = t ? 0 : this.bquad.tly;
  12219. if (this.runtime.pixel_rounding) {
  12220. r = r + .5 | 0;
  12221. i = i + .5 | 0
  12222. }
  12223. if (this.angle !== 0 && !t) {
  12224. e.save();
  12225. e.translate(r, i);
  12226. e.rotate(this.angle);
  12227. r = 0;
  12228. i = 0
  12229. }
  12230. var s = i + this.height;
  12231. var o = this.pxHeight;
  12232. o += this.line_height_offset * this.runtime.devicePixelRatio;
  12233. var u;
  12234. var a;
  12235. if (this.valign === 1) i += Math.max(this.height / 2 - this.lines.length * o / 2, 0);
  12236. else if (this.valign === 2) i += Math.max(this.height - this.lines.length * o - 2, 0);
  12237. for (a = 0; a < this.lines.length; a++) {
  12238. u = r;
  12239. if (this.halign === 1) u = r + (this.width - this.lines[a].width) / 2;
  12240. else if (this.halign === 2) u = r + (this.width - this.lines[a].width);
  12241. e.fillText(this.lines[a].text, u, i);
  12242. i += o;
  12243. if (i >= s - o) break
  12244. }
  12245. if (this.angle !== 0 || t) e.restore();
  12246. this.last_render_tick = this.runtime.tickcount
  12247. };
  12248. n.drawGL = function(e) {
  12249. if (this.width < 1 || this.height < 1) return;
  12250. var t = this.text_changed || this.need_text_redraw;
  12251. this.need_text_redraw = false;
  12252. var n = this.layer.getScale();
  12253. var r = this.layer.getAngle();
  12254. var i = this.rcTex;
  12255. var s = n * this.width;
  12256. var o = n * this.height;
  12257. var u = Math.ceil(s);
  12258. var a = Math.ceil(o);
  12259. var f = this.runtime.width;
  12260. var l = this.runtime.height;
  12261. var c = f / 2;
  12262. var h = l / 2;
  12263. if (!this.myctx) {
  12264. this.mycanvas = document.createElement("canvas");
  12265. this.mycanvas.width = u;
  12266. this.mycanvas.height = a;
  12267. this.lastwidth = u;
  12268. this.lastheight = a;
  12269. t = true;
  12270. this.myctx = this.mycanvas.getContext("2d")
  12271. }
  12272. if (u !== this.lastwidth || a !== this.lastheight) {
  12273. this.mycanvas.width = u;
  12274. this.mycanvas.height = a;
  12275. if (this.mytex) {
  12276. e.deleteTexture(this.mytex);
  12277. this.mytex = null
  12278. }
  12279. t = true
  12280. }
  12281. if (t) {
  12282. this.myctx.clearRect(0, 0, u, a);
  12283. this.draw(this.myctx, true);
  12284. if (!this.mytex) this.mytex = e.createEmptyTexture(u, a, this.runtime.linearSampling, this.runtime.isMobile);
  12285. e.videoToTexture(this.mycanvas, this.mytex, this.runtime.isMobile)
  12286. }
  12287. this.lastwidth = u;
  12288. this.lastheight = a;
  12289. e.setTexture(this.mytex);
  12290. e.setOpacity(this.opacity);
  12291. e.resetModelView();
  12292. e.translate(-c, -h);
  12293. e.updateModelView();
  12294. var p = this.bquad;
  12295. var d = this.layer.layerToCanvas(p.tlx, p.tly, true);
  12296. var v = this.layer.layerToCanvas(p.tlx, p.tly, false);
  12297. var m = this.layer.layerToCanvas(p.trx, p.try_, true);
  12298. var g = this.layer.layerToCanvas(p.trx, p.try_, false);
  12299. var y = this.layer.layerToCanvas(p.brx, p.bry, true);
  12300. var b = this.layer.layerToCanvas(p.brx, p.bry, false);
  12301. var w = this.layer.layerToCanvas(p.blx, p.bly, true);
  12302. var E = this.layer.layerToCanvas(p.blx, p.bly, false);
  12303. if (this.runtime.pixel_rounding || this.angle === 0 && r === 0) {
  12304. var S = (d + .5 | 0) - d;
  12305. var x = (v + .5 | 0) - v;
  12306. d += S;
  12307. v += x;
  12308. m += S;
  12309. g += x;
  12310. y += S;
  12311. b += x;
  12312. w += S;
  12313. E += x
  12314. }
  12315. if (this.angle === 0 && r === 0) {
  12316. m = d + u;
  12317. g = v;
  12318. y = m;
  12319. b = v + a;
  12320. w = d;
  12321. E = b;
  12322. i.right = 1;
  12323. i.bottom = 1
  12324. } else {
  12325. i.right = s / u;
  12326. i.bottom = o / a
  12327. }
  12328. e.quadTex(d, v, m, g, y, b, w, E, i);
  12329. e.resetModelView();
  12330. e.scale(n, n);
  12331. e.rotateZ(-this.layer.getAngle());
  12332. e.translate((this.layer.viewLeft + this.layer.viewRight) / -2, (this.layer.viewTop + this.layer.viewBottom) / -2);
  12333. e.updateModelView();
  12334. this.last_render_tick = this.runtime.tickcount
  12335. };
  12336. var i = [];
  12337. e.TokeniseWords = function(e) {
  12338. i.length = 0;
  12339. var t = "";
  12340. var n;
  12341. var r = 0;
  12342. while (r < e.length) {
  12343. n = e.charAt(r);
  12344. if (n === "\n") {
  12345. if (t.length) {
  12346. i.push(t);
  12347. t = ""
  12348. }
  12349. i.push("\n");
  12350. ++r
  12351. } else if (n === " " || n === " " || n === "-") {
  12352. do {
  12353. t += e.charAt(r);
  12354. r++
  12355. } while (r < e.length && (e.charAt(r) === " " || e.charAt(r) === " "));
  12356. i.push(t);
  12357. t = ""
  12358. } else if (r < e.length) {
  12359. t += n;
  12360. r++
  12361. }
  12362. }
  12363. if (t.length) i.push(t)
  12364. };
  12365. var s = [];
  12366. e.WordWrap = function(e, t, n, r, i) {
  12367. if (!e || !e.length) {
  12368. a(t);
  12369. return
  12370. }
  12371. if (r <= 2) {
  12372. a(t);
  12373. return
  12374. }
  12375. if (e.length <= 100 && e.indexOf("\n") === -1) {
  12376. var s = n.measureText(e).width;
  12377. if (s <= r) {
  12378. a(t);
  12379. t.push(o());
  12380. t[0].text = e;
  12381. t[0].width = s;
  12382. return
  12383. }
  12384. }
  12385. this.WrapText(e, t, n, r, i)
  12386. };
  12387. e.WrapText = function(e, t, n, r, s) {
  12388. var a;
  12389. if (s) {
  12390. this.TokeniseWords(e);
  12391. a = i
  12392. } else a = e;
  12393. var f = "";
  12394. var l;
  12395. var c;
  12396. var h;
  12397. var p = 0;
  12398. var d;
  12399. for (h = 0; h < a.length; h++) {
  12400. if (a[h] === "\n") {
  12401. if (p >= t.length) t.push(o());
  12402. d = t[p];
  12403. d.text = f;
  12404. d.width = n.measureText(f).width;
  12405. p++;
  12406. f = "";
  12407. continue
  12408. }
  12409. l = f;
  12410. f += a[h];
  12411. c = n.measureText(f).width;
  12412. if (c >= r) {
  12413. if (p >= t.length) t.push(o());
  12414. d = t[p];
  12415. d.text = l;
  12416. d.width = n.measureText(l).width;
  12417. p++;
  12418. f = a[h];
  12419. if (!s && f === " ") f = ""
  12420. }
  12421. }
  12422. if (f.length) {
  12423. if (p >= t.length) t.push(o());
  12424. d = t[p];
  12425. d.text = f;
  12426. d.width = n.measureText(f).width;
  12427. p++
  12428. }
  12429. for (h = p; h < t.length; h++) u(t[h]);
  12430. t.length = p
  12431. };
  12432. f.prototype.CompareText = function(e, t) {
  12433. if (t) return this.text == e;
  12434. else return cr.equals_nocase(this.text, e)
  12435. };
  12436. e.cnds = new f;
  12437. l.prototype.SetText = function(e) {
  12438. if (cr.is_number(e) && e < 1e9) e = Math.round(e * 1e10) / 1e10;
  12439. var t = e.toString();
  12440. if (this.text !== t) {
  12441. this.text = t;
  12442. this.text_changed = true;
  12443. this.runtime.redraw = true
  12444. }
  12445. };
  12446. l.prototype.AppendText = function(e) {
  12447. if (cr.is_number(e)) e = Math.round(e * 1e10) / 1e10;
  12448. var t = e.toString();
  12449. if (t) {
  12450. this.text += t;
  12451. this.text_changed = true;
  12452. this.runtime.redraw = true
  12453. }
  12454. };
  12455. l.prototype.SetFontFace = function(e, t) {
  12456. var n = "";
  12457. switch (t) {
  12458. case 1:
  12459. n = "bold";
  12460. break;
  12461. case 2:
  12462. n = "italic";
  12463. break;
  12464. case 3:
  12465. n = "bold italic";
  12466. break
  12467. }
  12468. if (e === this.facename && n === this.fontstyle) return;
  12469. this.facename = e;
  12470. this.fontstyle = n;
  12471. this.updateFont()
  12472. };
  12473. l.prototype.SetFontSize = function(e) {
  12474. if (this.ptSize === e) return;
  12475. this.ptSize = e;
  12476. this.pxHeight = Math.ceil(this.ptSize / 72 * 96) + 4;
  12477. this.updateFont()
  12478. };
  12479. l.prototype.SetFontColor = function(e) {
  12480. var t = "rgb(" + cr.GetRValue(e).toString() + "," + cr.GetGValue(e).toString() + "," + cr.GetBValue(e).toString() + ")";
  12481. if (t === this.color) return;
  12482. this.color = t;
  12483. this.need_text_redraw = true;
  12484. this.runtime.redraw = true
  12485. };
  12486. l.prototype.SetWebFont = function(e, t) {
  12487. if (this.runtime.isDomFree) {
  12488. cr.logexport("[Construct 2] Text plugin: 'Set web font' not supported on this platform - the action has been ignored");
  12489. return
  12490. }
  12491. var n = this;
  12492. var i = function() {
  12493. n.runtime.redraw = true;
  12494. n.text_changed = true
  12495. };
  12496. if (r.hasOwnProperty(t)) {
  12497. var s = "'" + e + "'";
  12498. if (this.facename === s) return;
  12499. this.facename = s;
  12500. this.updateFont();
  12501. for (var o = 1; o < 10; o++) {
  12502. setTimeout(i, o * 100);
  12503. setTimeout(i, o * 1e3)
  12504. }
  12505. return
  12506. }
  12507. var u = document.createElement("link");
  12508. u.href = t;
  12509. u.rel = "stylesheet";
  12510. u.type = "text/css";
  12511. u.onload = i;
  12512. document.getElementsByTagName("head")[0].appendChild(u);
  12513. r[t] = true;
  12514. this.facename = "'" + e + "'";
  12515. this.updateFont();
  12516. for (var o = 1; o < 10; o++) {
  12517. setTimeout(i, o * 100);
  12518. setTimeout(i, o * 1e3)
  12519. }
  12520. };
  12521. l.prototype.SetEffect = function(e) {
  12522. this.compositeOp = cr.effectToCompositeOp(e);
  12523. cr.setGLBlend(this, e, this.runtime.gl);
  12524. this.runtime.redraw = true
  12525. };
  12526. e.acts = new l;
  12527. c.prototype.Text = function(e) {
  12528. e.set_string(this.text)
  12529. };
  12530. c.prototype.FaceName = function(e) {
  12531. e.set_string(this.facename)
  12532. };
  12533. c.prototype.FaceSize = function(e) {
  12534. e.set_int(this.ptSize)
  12535. };
  12536. c.prototype.TextWidth = function(e) {
  12537. var t = 0;
  12538. var n, r, i;
  12539. for (n = 0, r = this.lines.length; n < r; n++) {
  12540. i = this.lines[n].width;
  12541. if (t < i) t = i
  12542. }
  12543. e.set_int(t)
  12544. };
  12545. c.prototype.TextHeight = function(e) {
  12546. e.set_int(this.lines.length * (this.pxHeight + this.line_height_offset) - this.line_height_offset)
  12547. };
  12548. e.exps = new c
  12549. })();
  12550. cr.plugins_.Touch = function(e) {
  12551. this.runtime = e
  12552. };
  12553. (function() {
  12554. function u(e) {
  12555. i = e.x;
  12556. s = e.y;
  12557. o = e.z
  12558. }
  12559. function c(e) {
  12560. a = e.x;
  12561. f = e.y;
  12562. l = e.z
  12563. }
  12564. function d() {}
  12565. function v() {}
  12566. var e = cr.plugins_.Touch.prototype;
  12567. e.Type = function(e) {
  12568. this.plugin = e;
  12569. this.runtime = e.runtime
  12570. };
  12571. var t = e.Type.prototype;
  12572. t.onCreate = function() {};
  12573. e.Instance = function(e) {
  12574. this.type = e;
  12575. this.runtime = e.runtime;
  12576. this.touches = [];
  12577. this.mouseDown = false
  12578. };
  12579. var n = e.Instance.prototype;
  12580. var r = {
  12581. left: 0,
  12582. top: 0
  12583. };
  12584. n.findTouch = function(e) {
  12585. var t, n;
  12586. for (t = 0, n = this.touches.length; t < n; t++) {
  12587. if (this.touches[t]["id"] === e) return t
  12588. }
  12589. return -1
  12590. };
  12591. var i = 0;
  12592. var s = 0;
  12593. var o = 0;
  12594. var a = 0;
  12595. var f = 0;
  12596. var l = 0;
  12597. var h = null;
  12598. n.onCreate = function() {
  12599. h = this;
  12600. this.isWindows8 = !!(typeof window["c2isWindows8"] !== "undefined" && window["c2isWindows8"]);
  12601. this.orient_alpha = 0;
  12602. this.orient_beta = 0;
  12603. this.orient_gamma = 0;
  12604. this.acc_g_x = 0;
  12605. this.acc_g_y = 0;
  12606. this.acc_g_z = 0;
  12607. this.acc_x = 0;
  12608. this.acc_y = 0;
  12609. this.acc_z = 0;
  12610. this.curTouchX = 0;
  12611. this.curTouchY = 0;
  12612. this.trigger_index = 0;
  12613. this.trigger_id = 0;
  12614. this.useMouseInput = this.properties[0] !== 0;
  12615. var e = this.runtime.fullscreen_mode > 0 ? document : this.runtime.canvas;
  12616. var t = document;
  12617. if (this.runtime.isDirectCanvas) t = e = window["Canvas"];
  12618. else if (this.runtime.isCocoonJs) t = e = window;
  12619. var n = this;
  12620. if (window.navigator["msPointerEnabled"]) {
  12621. e.addEventListener("MSPointerDown", function(e) {
  12622. n.onPointerStart(e)
  12623. }, false);
  12624. e.addEventListener("MSPointerMove", function(e) {
  12625. n.onPointerMove(e)
  12626. }, false);
  12627. t.addEventListener("MSPointerUp", function(e) {
  12628. n.onPointerEnd(e)
  12629. }, false);
  12630. t.addEventListener("MSPointerCancel", function(e) {
  12631. n.onPointerEnd(e)
  12632. }, false);
  12633. if (this.runtime.canvas) {
  12634. this.runtime.canvas.addEventListener("MSGestureHold", function(e) {
  12635. e.preventDefault()
  12636. }, false);
  12637. document.addEventListener("MSGestureHold", function(e) {
  12638. e.preventDefault()
  12639. }, false)
  12640. }
  12641. } else {
  12642. e.addEventListener("touchstart", function(e) {
  12643. n.onTouchStart(e)
  12644. }, false);
  12645. e.addEventListener("touchmove", function(e) {
  12646. n.onTouchMove(e)
  12647. }, false);
  12648. t.addEventListener("touchend", function(e) {
  12649. n.onTouchEnd(e)
  12650. }, false);
  12651. t.addEventListener("touchcancel", function(e) {
  12652. n.onTouchEnd(e)
  12653. }, false)
  12654. } if (this.isWindows8) {
  12655. var r = function(e) {
  12656. var t = e["reading"];
  12657. n.acc_x = t["accelerationX"];
  12658. n.acc_y = t["accelerationY"];
  12659. n.acc_z = t["accelerationZ"]
  12660. };
  12661. var i = function(e) {
  12662. var t = e["reading"];
  12663. n.orient_alpha = t["yawDegrees"];
  12664. n.orient_beta = t["pitchDegrees"];
  12665. n.orient_gamma = t["rollDegrees"]
  12666. };
  12667. var s = Windows["Devices"]["Sensors"]["Accelerometer"]["getDefault"]();
  12668. if (s) {
  12669. s["reportInterval"] = Math.max(s["minimumReportInterval"], 16);
  12670. s.addEventListener("readingchanged", r)
  12671. }
  12672. var o = Windows["Devices"]["Sensors"]["Inclinometer"]["getDefault"]();
  12673. if (o) {
  12674. o["reportInterval"] = Math.max(o["minimumReportInterval"], 16);
  12675. o.addEventListener("readingchanged", i)
  12676. }
  12677. document.addEventListener("visibilitychange", function(e) {
  12678. if (document["hidden"] || document["msHidden"]) {
  12679. if (s) s.removeEventListener("readingchanged", r);
  12680. if (o) o.removeEventListener("readingchanged", i)
  12681. } else {
  12682. if (s) s.addEventListener("readingchanged", r);
  12683. if (o) o.addEventListener("readingchanged", i)
  12684. }
  12685. }, false)
  12686. } else {
  12687. window.addEventListener("deviceorientation", function(e) {
  12688. n.orient_alpha = e["alpha"] || 0;
  12689. n.orient_beta = e["beta"] || 0;
  12690. n.orient_gamma = e["gamma"] || 0
  12691. }, false);
  12692. window.addEventListener("devicemotion", function(e) {
  12693. if (e["accelerationIncludingGravity"]) {
  12694. n.acc_g_x = e["accelerationIncludingGravity"]["x"];
  12695. n.acc_g_y = e["accelerationIncludingGravity"]["y"];
  12696. n.acc_g_z = e["accelerationIncludingGravity"]["z"]
  12697. }
  12698. if (e["acceleration"]) {
  12699. n.acc_x = e["acceleration"]["x"];
  12700. n.acc_y = e["acceleration"]["y"];
  12701. n.acc_z = e["acceleration"]["z"]
  12702. }
  12703. }, false)
  12704. } if (this.useMouseInput && !this.runtime.isDomFree) {
  12705. jQuery(document).mousemove(function(e) {
  12706. n.onMouseMove(e)
  12707. });
  12708. jQuery(document).mousedown(function(e) {
  12709. n.onMouseDown(e)
  12710. });
  12711. jQuery(document).mouseup(function(e) {
  12712. n.onMouseUp(e)
  12713. })
  12714. }
  12715. if (this.runtime.isAppMobi && !this.runtime.isDirectCanvas) {
  12716. AppMobi["accelerometer"]["watchAcceleration"](u, {
  12717. frequency: 40,
  12718. adjustForRotation: true
  12719. })
  12720. }
  12721. if (this.runtime.isPhoneGap) {
  12722. navigator["accelerometer"]["watchAcceleration"](c, null, {
  12723. frequency: 40
  12724. })
  12725. }
  12726. this.runtime.tick2Me(this)
  12727. };
  12728. n.onPointerMove = function(e) {
  12729. if (e["pointerType"] === e["MSPOINTER_TYPE_MOUSE"]) return;
  12730. if (e.preventDefault) e.preventDefault();
  12731. var t = this.findTouch(e["pointerId"]);
  12732. var n = cr.performance_now();
  12733. if (t >= 0) {
  12734. var i = this.runtime.isDomFree ? r : jQuery(this.runtime.canvas).offset();
  12735. var s = this.touches[t];
  12736. if (n - s.time < 2) return;
  12737. s.lasttime = s.time;
  12738. s.lastx = s.x;
  12739. s.lasty = s.y;
  12740. s.time = n;
  12741. s.x = e.pageX - i.left;
  12742. s.y = e.pageY - i.top
  12743. }
  12744. };
  12745. n.onPointerStart = function(e) {
  12746. if (e["pointerType"] === e["MSPOINTER_TYPE_MOUSE"]) return;
  12747. if (e.preventDefault) e.preventDefault();
  12748. var t = this.runtime.isDomFree ? r : jQuery(this.runtime.canvas).offset();
  12749. var n = e.pageX - t.left;
  12750. var i = e.pageY - t.top;
  12751. var s = cr.performance_now();
  12752. this.trigger_index = this.touches.length;
  12753. this.trigger_id = e["pointerId"];
  12754. this.touches.push({
  12755. time: s,
  12756. x: n,
  12757. y: i,
  12758. lasttime: s,
  12759. lastx: n,
  12760. lasty: i,
  12761. id: e["pointerId"],
  12762. startindex: this.trigger_index
  12763. });
  12764. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnNthTouchStart, this);
  12765. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchStart, this);
  12766. this.curTouchX = n;
  12767. this.curTouchY = i;
  12768. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchObject, this)
  12769. };
  12770. n.onPointerEnd = function(e) {
  12771. if (e["pointerType"] === e["MSPOINTER_TYPE_MOUSE"]) return;
  12772. if (e.preventDefault) e.preventDefault();
  12773. var t = this.findTouch(e["pointerId"]);
  12774. this.trigger_index = t >= 0 ? this.touches[t].startindex : -1;
  12775. this.trigger_id = t >= 0 ? this.touches[t]["id"] : -1;
  12776. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnNthTouchEnd, this);
  12777. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchEnd, this);
  12778. if (t >= 0) {
  12779. this.touches.splice(t, 1)
  12780. }
  12781. };
  12782. n.onTouchMove = function(e) {
  12783. var t = cr.performance_now();
  12784. var n, i, s, o;
  12785. for (n = 0, i = e.changedTouches.length; n < i; n++) {
  12786. s = e.changedTouches[n];
  12787. var u = this.findTouch(s["identifier"]);
  12788. if (u >= 0) {
  12789. var a = this.runtime.isDomFree ? r : jQuery(this.runtime.canvas).offset();
  12790. o = this.touches[u];
  12791. if (t - o.time < 2) continue;
  12792. o.lasttime = o.time;
  12793. o.lastx = o.x;
  12794. o.lasty = o.y;
  12795. o.time = t;
  12796. o.x = s.pageX - a.left;
  12797. o.y = s.pageY - a.top
  12798. }
  12799. }
  12800. };
  12801. n.onTouchStart = function(e) {
  12802. var t = this.runtime.isDomFree ? r : jQuery(this.runtime.canvas).offset();
  12803. var n = cr.performance_now();
  12804. var i, s, o, u;
  12805. for (i = 0, s = e.changedTouches.length; i < s; i++) {
  12806. o = e.changedTouches[i];
  12807. u = this.findTouch(o["identifier"]);
  12808. if (u !== -1) continue;
  12809. var a = o.pageX - t.left;
  12810. var f = o.pageY - t.top;
  12811. this.trigger_index = this.touches.length;
  12812. this.trigger_id = o["identifier"];
  12813. this.touches.push({
  12814. time: n,
  12815. x: a,
  12816. y: f,
  12817. lasttime: n,
  12818. lastx: a,
  12819. lasty: f,
  12820. id: o["identifier"],
  12821. startindex: this.trigger_index
  12822. });
  12823. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnNthTouchStart, this);
  12824. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchStart, this);
  12825. this.curTouchX = a;
  12826. this.curTouchY = f;
  12827. if (navigator.userAgent.match(/iphone|ipod|ios/i)) this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchObject, this)
  12828. }
  12829. };
  12830. n.onTouchEnd = function(e) {
  12831. var t, n, r, i;
  12832. for (t = 0, n = e.changedTouches.length; t < n; t++) {
  12833. r = e.changedTouches[t];
  12834. i = this.findTouch(r["identifier"]);
  12835. if (i >= 0) {
  12836. this.trigger_index = this.touches[i].startindex;
  12837. this.trigger_id = this.touches[i]["id"];
  12838. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnNthTouchEnd, this);
  12839. this.runtime.trigger(cr.plugins_.Touch.prototype.cnds.OnTouchEnd, this);
  12840. this.touches.splice(i, 1)
  12841. }
  12842. }
  12843. };
  12844. n.getAlpha = function() {
  12845. if (this.runtime.isAppMobi && this.orient_alpha === 0 && o !== 0) return o * 90;
  12846. else if (this.runtime.isPhoneGap && this.orient_alpha === 0 && l !== 0) return l * 90;
  12847. else return this.orient_alpha
  12848. };
  12849. n.getBeta = function() {
  12850. if (this.runtime.isAppMobi && this.orient_beta === 0 && s !== 0) return s * -90;
  12851. else if (this.runtime.isPhoneGap && this.orient_beta === 0 && f !== 0) return f * -90;
  12852. else return this.orient_beta
  12853. };
  12854. n.getGamma = function() {
  12855. if (this.runtime.isAppMobi && this.orient_gamma === 0 && i !== 0) return i * 90;
  12856. else if (this.runtime.isPhoneGap && this.orient_gamma === 0 && a !== 0) return a * 90;
  12857. else return this.orient_gamma
  12858. };
  12859. var p = function() {};
  12860. n.onMouseDown = function(e) {
  12861. if (e.preventDefault && this.runtime.had_a_click) e.preventDefault();
  12862. var t = {
  12863. pageX: e.pageX,
  12864. pageY: e.pageY,
  12865. identifier: 0
  12866. };
  12867. var n = {
  12868. changedTouches: [t]
  12869. };
  12870. this.onTouchStart(n);
  12871. this.mouseDown = true
  12872. };
  12873. n.onMouseMove = function(e) {
  12874. if (e.preventDefault && this.runtime.had_a_click) e.preventDefault();
  12875. if (!this.mouseDown) return;
  12876. var t = {
  12877. pageX: e.pageX,
  12878. pageY: e.pageY,
  12879. identifier: 0
  12880. };
  12881. var n = {
  12882. changedTouches: [t]
  12883. };
  12884. this.onTouchMove(n)
  12885. };
  12886. n.onMouseUp = function(e) {
  12887. if (e.preventDefault && this.runtime.had_a_click) e.preventDefault();
  12888. this.runtime.had_a_click = true;
  12889. var t = {
  12890. pageX: e.pageX,
  12891. pageY: e.pageY,
  12892. identifier: 0
  12893. };
  12894. var n = {
  12895. changedTouches: [t]
  12896. };
  12897. this.onTouchEnd(n);
  12898. this.mouseDown = false
  12899. };
  12900. n.tick2 = function() {
  12901. var e, t, n;
  12902. var r = cr.performance_now();
  12903. for (e = 0, t = this.touches.length; e < t; e++) {
  12904. n = this.touches[e];
  12905. if (n.time <= r - 50) n.lasttime = r
  12906. }
  12907. };
  12908. d.prototype.OnTouchStart = function() {
  12909. return true
  12910. };
  12911. d.prototype.OnTouchEnd = function() {
  12912. return true
  12913. };
  12914. d.prototype.IsInTouch = function() {
  12915. return this.touches.length
  12916. };
  12917. d.prototype.OnTouchObject = function(e) {
  12918. if (!e) return false;
  12919. return this.runtime.testAndSelectCanvasPointOverlap(e, this.curTouchX, this.curTouchY, false)
  12920. };
  12921. d.prototype.IsTouchingObject = function(e) {
  12922. if (!e) return false;
  12923. var t = e.getCurrentSol();
  12924. var n = t.getObjects();
  12925. var r, i;
  12926. var s = [];
  12927. var o, u, a, f;
  12928. for (o = 0, u = n.length; o < u; o++) {
  12929. var l = n[o];
  12930. l.update_bbox();
  12931. for (a = 0, f = this.touches.length; a < f; a++) {
  12932. var c = this.touches[a];
  12933. r = l.layer.canvasToLayer(c.x, c.y, true);
  12934. i = l.layer.canvasToLayer(c.x, c.y, false);
  12935. if (l.contains_pt(r, i)) {
  12936. s.push(l);
  12937. break
  12938. }
  12939. }
  12940. }
  12941. if (s.length) {
  12942. t.select_all = false;
  12943. t.instances = s;
  12944. return true
  12945. } else return false
  12946. };
  12947. d.prototype.CompareTouchSpeed = function(e, t, n) {
  12948. e = Math.floor(e);
  12949. if (e < 0 || e >= this.touches.length) return false;
  12950. var r = this.touches[e];
  12951. var i = cr.distanceTo(r.x, r.y, r.lastx, r.lasty);
  12952. var s = (r.time - r.lasttime) / 1e3;
  12953. var o = 0;
  12954. if (s > 0) o = i / s;
  12955. return cr.do_cmp(o, t, n)
  12956. };
  12957. d.prototype.OrientationSupported = function() {
  12958. return typeof window["DeviceOrientationEvent"] !== "undefined"
  12959. };
  12960. d.prototype.MotionSupported = function() {
  12961. return typeof window["DeviceMotionEvent"] !== "undefined"
  12962. };
  12963. d.prototype.CompareOrientation = function(e, t, n) {
  12964. var r = 0;
  12965. if (e === 0) r = this.getAlpha();
  12966. else if (e === 1) r = this.getBeta();
  12967. else r = this.getGamma();
  12968. return cr.do_cmp(r, t, n)
  12969. };
  12970. d.prototype.CompareAcceleration = function(e, t, n) {
  12971. var r = 0;
  12972. if (e === 0) r = this.acc_g_x;
  12973. else if (e === 1) r = this.acc_g_y;
  12974. else if (e === 2) r = this.acc_g_z;
  12975. else if (e === 3) r = this.acc_x;
  12976. else if (e === 4) r = this.acc_y;
  12977. else if (e === 5) r = this.acc_z;
  12978. return cr.do_cmp(r, t, n)
  12979. };
  12980. d.prototype.OnNthTouchStart = function(e) {
  12981. e = Math.floor(e);
  12982. return e === this.trigger_index
  12983. };
  12984. d.prototype.OnNthTouchEnd = function(e) {
  12985. e = Math.floor(e);
  12986. return e === this.trigger_index
  12987. };
  12988. d.prototype.HasNthTouch = function(e) {
  12989. e = Math.floor(e);
  12990. return this.touches.length >= e + 1
  12991. };
  12992. e.cnds = new d;
  12993. v.prototype.TouchCount = function(e) {
  12994. e.set_int(this.touches.length)
  12995. };
  12996. v.prototype.X = function(e, t) {
  12997. if (this.touches.length) {
  12998. var n, r, i, s, o;
  12999. if (cr.is_undefined(t)) {
  13000. n = this.runtime.getLayerByNumber(0);
  13001. r = n.scale;
  13002. i = n.zoomRate;
  13003. s = n.parallaxX;
  13004. o = n.angle;
  13005. n.scale = this.runtime.running_layout.scale;
  13006. n.zoomRate = 1;
  13007. n.parallaxX = 1;
  13008. n.angle = this.runtime.running_layout.angle;
  13009. e.set_float(n.canvasToLayer(this.touches[0].x, this.touches[0].y, true));
  13010. n.scale = r;
  13011. n.zoomRate = i;
  13012. n.parallaxX = s;
  13013. n.angle = o
  13014. } else {
  13015. if (cr.is_number(t)) n = this.runtime.getLayerByNumber(t);
  13016. else n = this.runtime.getLayerByName(t); if (n) e.set_float(n.canvasToLayer(this.touches[0].x, this.touches[0].y, true));
  13017. else e.set_float(0)
  13018. }
  13019. } else e.set_float(0)
  13020. };
  13021. v.prototype.XAt = function(e, t, n) {
  13022. t = Math.floor(t);
  13023. if (t < 0 || t >= this.touches.length) {
  13024. e.set_float(0);
  13025. return
  13026. }
  13027. var r, i, s, o, u;
  13028. if (cr.is_undefined(n)) {
  13029. r = this.runtime.getLayerByNumber(0);
  13030. i = r.scale;
  13031. s = r.zoomRate;
  13032. o = r.parallaxX;
  13033. u = r.angle;
  13034. r.scale = this.runtime.running_layout.scale;
  13035. r.zoomRate = 1;
  13036. r.parallaxX = 1;
  13037. r.angle = this.runtime.running_layout.angle;
  13038. e.set_float(r.canvasToLayer(this.touches[t].x, this.touches[t].y, true));
  13039. r.scale = i;
  13040. r.zoomRate = s;
  13041. r.parallaxX = o;
  13042. r.angle = u
  13043. } else {
  13044. if (cr.is_number(n)) r = this.runtime.getLayerByNumber(n);
  13045. else r = this.runtime.getLayerByName(n); if (r) e.set_float(r.canvasToLayer(this.touches[t].x, this.touches[t].y, true));
  13046. else e.set_float(0)
  13047. }
  13048. };
  13049. v.prototype.XForID = function(e, t, n) {
  13050. var r = this.findTouch(t);
  13051. if (r < 0) {
  13052. e.set_float(0);
  13053. return
  13054. }
  13055. var i = this.touches[r];
  13056. var s, o, u, a, f;
  13057. if (cr.is_undefined(n)) {
  13058. s = this.runtime.getLayerByNumber(0);
  13059. o = s.scale;
  13060. u = s.zoomRate;
  13061. a = s.parallaxX;
  13062. f = s.angle;
  13063. s.scale = this.runtime.running_layout.scale;
  13064. s.zoomRate = 1;
  13065. s.parallaxX = 1;
  13066. s.angle = this.runtime.running_layout.angle;
  13067. e.set_float(s.canvasToLayer(i.x, i.y, true));
  13068. s.scale = o;
  13069. s.zoomRate = u;
  13070. s.parallaxX = a;
  13071. s.angle = f
  13072. } else {
  13073. if (cr.is_number(n)) s = this.runtime.getLayerByNumber(n);
  13074. else s = this.runtime.getLayerByName(n); if (s) e.set_float(s.canvasToLayer(i.x, i.y, true));
  13075. else e.set_float(0)
  13076. }
  13077. };
  13078. v.prototype.Y = function(e, t) {
  13079. if (this.touches.length) {
  13080. var n, r, i, s, o;
  13081. if (cr.is_undefined(t)) {
  13082. n = this.runtime.getLayerByNumber(0);
  13083. r = n.scale;
  13084. i = n.zoomRate;
  13085. s = n.parallaxY;
  13086. o = n.angle;
  13087. n.scale = this.runtime.running_layout.scale;
  13088. n.zoomRate = 1;
  13089. n.parallaxY = 1;
  13090. n.angle = this.runtime.running_layout.angle;
  13091. e.set_float(n.canvasToLayer(this.touches[0].x, this.touches[0].y, false));
  13092. n.scale = r;
  13093. n.zoomRate = i;
  13094. n.parallaxY = s;
  13095. n.angle = o
  13096. } else {
  13097. if (cr.is_number(t)) n = this.runtime.getLayerByNumber(t);
  13098. else n = this.runtime.getLayerByName(t); if (n) e.set_float(n.canvasToLayer(this.touches[0].x, this.touches[0].y, false));
  13099. else e.set_float(0)
  13100. }
  13101. } else e.set_float(0)
  13102. };
  13103. v.prototype.YAt = function(e, t, n) {
  13104. t = Math.floor(t);
  13105. if (t < 0 || t >= this.touches.length) {
  13106. e.set_float(0);
  13107. return
  13108. }
  13109. var r, i, s, o, u;
  13110. if (cr.is_undefined(n)) {
  13111. r = this.runtime.getLayerByNumber(0);
  13112. i = r.scale;
  13113. s = r.zoomRate;
  13114. o = r.parallaxY;
  13115. u = r.angle;
  13116. r.scale = this.runtime.running_layout.scale;
  13117. r.zoomRate = 1;
  13118. r.parallaxY = 1;
  13119. r.angle = this.runtime.running_layout.angle;
  13120. e.set_float(r.canvasToLayer(this.touches[t].x, this.touches[t].y, false));
  13121. r.scale = i;
  13122. r.zoomRate = s;
  13123. r.parallaxY = o;
  13124. r.angle = u
  13125. } else {
  13126. if (cr.is_number(n)) r = this.runtime.getLayerByNumber(n);
  13127. else r = this.runtime.getLayerByName(n); if (r) e.set_float(r.canvasToLayer(this.touches[t].x, this.touches[t].y, false));
  13128. else e.set_float(0)
  13129. }
  13130. };
  13131. v.prototype.YForID = function(e, t, n) {
  13132. var r = this.findTouch(t);
  13133. if (r < 0) {
  13134. e.set_float(0);
  13135. return
  13136. }
  13137. var i = this.touches[r];
  13138. var s, o, u, a, f;
  13139. if (cr.is_undefined(n)) {
  13140. s = this.runtime.getLayerByNumber(0);
  13141. o = s.scale;
  13142. u = s.zoomRate;
  13143. a = s.parallaxY;
  13144. f = s.angle;
  13145. s.scale = this.runtime.running_layout.scale;
  13146. s.zoomRate = 1;
  13147. s.parallaxY = 1;
  13148. s.angle = this.runtime.running_layout.angle;
  13149. e.set_float(s.canvasToLayer(i.x, i.y, false));
  13150. s.scale = o;
  13151. s.zoomRate = u;
  13152. s.parallaxY = a;
  13153. s.angle = f
  13154. } else {
  13155. if (cr.is_number(n)) s = this.runtime.getLayerByNumber(n);
  13156. else s = this.runtime.getLayerByName(n); if (s) e.set_float(s.canvasToLayer(i.x, i.y, false));
  13157. else e.set_float(0)
  13158. }
  13159. };
  13160. v.prototype.AbsoluteX = function(e) {
  13161. if (this.touches.length) e.set_float(this.touches[0].x);
  13162. else e.set_float(0)
  13163. };
  13164. v.prototype.AbsoluteXAt = function(e, t) {
  13165. t = Math.floor(t);
  13166. if (t < 0 || t >= this.touches.length) {
  13167. e.set_float(0);
  13168. return
  13169. }
  13170. e.set_float(this.touches[t].x)
  13171. };
  13172. v.prototype.AbsoluteXForID = function(e, t) {
  13173. var n = this.findTouch(t);
  13174. if (n < 0) {
  13175. e.set_float(0);
  13176. return
  13177. }
  13178. var r = this.touches[n];
  13179. e.set_float(r.x)
  13180. };
  13181. v.prototype.AbsoluteY = function(e) {
  13182. if (this.touches.length) e.set_float(this.touches[0].y);
  13183. else e.set_float(0)
  13184. };
  13185. v.prototype.AbsoluteYAt = function(e, t) {
  13186. t = Math.floor(t);
  13187. if (t < 0 || t >= this.touches.length) {
  13188. e.set_float(0);
  13189. return
  13190. }
  13191. e.set_float(this.touches[t].y)
  13192. };
  13193. v.prototype.AbsoluteYForID = function(e, t) {
  13194. var n = this.findTouch(t);
  13195. if (n < 0) {
  13196. e.set_float(0);
  13197. return
  13198. }
  13199. var r = this.touches[n];
  13200. e.set_float(r.y)
  13201. };
  13202. v.prototype.SpeedAt = function(e, t) {
  13203. t = Math.floor(t);
  13204. if (t < 0 || t >= this.touches.length) {
  13205. e.set_float(0);
  13206. return
  13207. }
  13208. var n = this.touches[t];
  13209. var r = cr.distanceTo(n.x, n.y, n.lastx, n.lasty);
  13210. var i = (n.time - n.lasttime) / 1e3;
  13211. if (i === 0) e.set_float(0);
  13212. else e.set_float(r / i)
  13213. };
  13214. v.prototype.SpeedForID = function(e, t) {
  13215. var n = this.findTouch(t);
  13216. if (n < 0) {
  13217. e.set_float(0);
  13218. return
  13219. }
  13220. var r = this.touches[n];
  13221. var i = cr.distanceTo(r.x, r.y, r.lastx, r.lasty);
  13222. var s = (r.time - r.lasttime) / 1e3;
  13223. if (s === 0) e.set_float(0);
  13224. else e.set_float(i / s)
  13225. };
  13226. v.prototype.AngleAt = function(e, t) {
  13227. t = Math.floor(t);
  13228. if (t < 0 || t >= this.touches.length) {
  13229. e.set_float(0);
  13230. return
  13231. }
  13232. var n = this.touches[t];
  13233. e.set_float(cr.to_degrees(cr.angleTo(n.lastx, n.lasty, n.x, n.y)))
  13234. };
  13235. v.prototype.AngleForID = function(e, t) {
  13236. var n = this.findTouch(t);
  13237. if (n < 0) {
  13238. e.set_float(0);
  13239. return
  13240. }
  13241. var r = this.touches[n];
  13242. e.set_float(cr.to_degrees(cr.angleTo(r.lastx, r.lasty, r.x, r.y)))
  13243. };
  13244. v.prototype.Alpha = function(e) {
  13245. e.set_float(this.getAlpha())
  13246. };
  13247. v.prototype.Beta = function(e) {
  13248. e.set_float(this.getBeta())
  13249. };
  13250. v.prototype.Gamma = function(e) {
  13251. e.set_float(this.getGamma())
  13252. };
  13253. v.prototype.AccelerationXWithG = function(e) {
  13254. e.set_float(this.acc_g_x)
  13255. };
  13256. v.prototype.AccelerationYWithG = function(e) {
  13257. e.set_float(this.acc_g_y)
  13258. };
  13259. v.prototype.AccelerationZWithG = function(e) {
  13260. e.set_float(this.acc_g_z)
  13261. };
  13262. v.prototype.AccelerationX = function(e) {
  13263. e.set_float(this.acc_x)
  13264. };
  13265. v.prototype.AccelerationY = function(e) {
  13266. e.set_float(this.acc_y)
  13267. };
  13268. v.prototype.AccelerationZ = function(e) {
  13269. e.set_float(this.acc_z)
  13270. };
  13271. v.prototype.TouchIndex = function(e) {
  13272. e.set_int(this.trigger_index)
  13273. };
  13274. v.prototype.TouchID = function(e) {
  13275. e.set_float(this.trigger_id)
  13276. };
  13277. e.exps = new v
  13278. })();
  13279. cr.behaviors.Fade = function(e) {
  13280. this.runtime = e
  13281. };
  13282. (function() {
  13283. function r() {}
  13284. function i() {}
  13285. var e = cr.behaviors.Fade.prototype;
  13286. e.Type = function(e, t) {
  13287. this.behavior = e;
  13288. this.objtype = t;
  13289. this.runtime = e.runtime
  13290. };
  13291. var t = e.Type.prototype;
  13292. t.onCreate = function() {};
  13293. e.Instance = function(e, t) {
  13294. this.type = e;
  13295. this.behavior = e.behavior;
  13296. this.inst = t;
  13297. this.runtime = e.runtime
  13298. };
  13299. var n = e.Instance.prototype;
  13300. n.onCreate = function() {
  13301. var e = this.properties[0] === 1;
  13302. this.fadeInTime = this.properties[1];
  13303. this.waitTime = this.properties[2];
  13304. this.fadeOutTime = this.properties[3];
  13305. this.destroy = this.properties[4];
  13306. this.stage = e ? 0 : 3;
  13307. if (this.recycled) this.stageTime.reset();
  13308. else this.stageTime = new cr.KahanAdder;
  13309. this.maxOpacity = this.inst.opacity ? this.inst.opacity : 1;
  13310. if (e) {
  13311. if (this.fadeInTime === 0) {
  13312. this.stage = 1;
  13313. if (this.waitTime === 0) this.stage = 2
  13314. } else {
  13315. this.inst.opacity = 0;
  13316. this.runtime.redraw = true
  13317. }
  13318. }
  13319. };
  13320. n.saveToJSON = function() {
  13321. return {
  13322. fit: this.fadeInTime,
  13323. wt: this.waitTime,
  13324. fot: this.fadeOutTime,
  13325. s: this.stage,
  13326. st: this.stageTime.sum,
  13327. mo: this.maxOpacity
  13328. }
  13329. };
  13330. n.loadFromJSON = function(e) {
  13331. this.fadeInTime = e["fit"];
  13332. this.waitTime = e["wt"];
  13333. this.fadeOutTime = e["fot"];
  13334. this.stage = e["s"];
  13335. this.stageTime.reset();
  13336. this.stageTime.sum = e["st"];
  13337. this.maxOpacity = e["mo"]
  13338. };
  13339. n.tick = function() {
  13340. this.stageTime.add(this.runtime.getDt(this.inst));
  13341. if (this.stage === 0) {
  13342. this.inst.opacity = this.stageTime.sum / this.fadeInTime * this.maxOpacity;
  13343. this.runtime.redraw = true;
  13344. if (this.inst.opacity >= this.maxOpacity) {
  13345. this.inst.opacity = this.maxOpacity;
  13346. this.stage = 1;
  13347. this.stageTime.reset()
  13348. }
  13349. }
  13350. if (this.stage === 1) {
  13351. if (this.stageTime.sum >= this.waitTime) {
  13352. this.stage = 2;
  13353. this.stageTime.reset()
  13354. }
  13355. }
  13356. if (this.stage === 2) {
  13357. if (this.fadeOutTime !== 0) {
  13358. this.inst.opacity = this.maxOpacity - this.stageTime.sum / this.fadeOutTime * this.maxOpacity;
  13359. this.runtime.redraw = true;
  13360. if (this.inst.opacity < 0) {
  13361. this.inst.opacity = 0;
  13362. this.stage = 3;
  13363. this.stageTime.reset();
  13364. this.runtime.trigger(cr.behaviors.Fade.prototype.cnds.OnFadeOutEnd, this.inst);
  13365. if (this.destroy === 1) this.runtime.DestroyInstance(this.inst)
  13366. }
  13367. }
  13368. }
  13369. };
  13370. n.doStart = function() {
  13371. this.stage = 0;
  13372. this.stageTime.reset();
  13373. if (this.fadeInTime === 0) {
  13374. this.stage = 1;
  13375. if (this.waitTime === 0) this.stage = 2
  13376. } else {
  13377. this.inst.opacity = 0;
  13378. this.runtime.redraw = true
  13379. }
  13380. };
  13381. r.prototype.OnFadeOutEnd = function() {
  13382. return true
  13383. };
  13384. e.cnds = new r;
  13385. i.prototype.StartFade = function() {
  13386. if (this.stage === 3) this.doStart()
  13387. };
  13388. i.prototype.RestartFade = function() {
  13389. this.doStart()
  13390. };
  13391. e.acts = new i
  13392. })();
  13393. cr.behaviors.Sin = function(e) {
  13394. this.runtime = e
  13395. };
  13396. (function() {
  13397. function o() {}
  13398. function u() {}
  13399. function a() {}
  13400. var e = cr.behaviors.Sin.prototype;
  13401. e.Type = function(e, t) {
  13402. this.behavior = e;
  13403. this.objtype = t;
  13404. this.runtime = e.runtime
  13405. };
  13406. var t = e.Type.prototype;
  13407. t.onCreate = function() {};
  13408. e.Instance = function(e, t) {
  13409. this.type = e;
  13410. this.behavior = e.behavior;
  13411. this.inst = t;
  13412. this.runtime = e.runtime;
  13413. this.i = 0
  13414. };
  13415. var n = e.Instance.prototype;
  13416. var r = 2 * Math.PI;
  13417. var i = Math.PI / 2;
  13418. var s = 3 * Math.PI / 2;
  13419. n.onCreate = function() {
  13420. this.active = this.properties[0] === 1;
  13421. this.movement = this.properties[1];
  13422. this.wave = this.properties[2];
  13423. this.period = this.properties[3];
  13424. this.period += Math.random() * this.properties[4];
  13425. if (this.period === 0) this.i = 0;
  13426. else {
  13427. this.i = this.properties[5] / this.period * r;
  13428. this.i += Math.random() * this.properties[6] / this.period * r
  13429. }
  13430. this.mag = this.properties[7];
  13431. this.mag += Math.random() * this.properties[8];
  13432. this.initialValue = 0;
  13433. this.initialValue2 = 0;
  13434. this.ratio = 0;
  13435. this.init()
  13436. };
  13437. n.saveToJSON = function() {
  13438. return {
  13439. i: this.i,
  13440. a: this.active,
  13441. mv: this.movement,
  13442. w: this.wave,
  13443. p: this.period,
  13444. mag: this.mag,
  13445. iv: this.initialValue,
  13446. iv2: this.initialValue2,
  13447. r: this.ratio,
  13448. lkv: this.lastKnownValue,
  13449. lkv2: this.lastKnownValue2
  13450. }
  13451. };
  13452. n.loadFromJSON = function(e) {
  13453. this.i = e["i"];
  13454. this.active = e["a"];
  13455. this.movement = e["mv"];
  13456. this.wave = e["w"];
  13457. this.period = e["p"];
  13458. this.mag = e["mag"];
  13459. this.initialValue = e["iv"];
  13460. this.initialValue2 = e["iv2"] || 0;
  13461. this.ratio = e["r"];
  13462. this.lastKnownValue = e["lkv"];
  13463. this.lastKnownValue2 = e["lkv2"] || 0
  13464. };
  13465. n.init = function() {
  13466. switch (this.movement) {
  13467. case 0:
  13468. this.initialValue = this.inst.x;
  13469. break;
  13470. case 1:
  13471. this.initialValue = this.inst.y;
  13472. break;
  13473. case 2:
  13474. this.initialValue = this.inst.width;
  13475. this.ratio = this.inst.height / this.inst.width;
  13476. break;
  13477. case 3:
  13478. this.initialValue = this.inst.width;
  13479. break;
  13480. case 4:
  13481. this.initialValue = this.inst.height;
  13482. break;
  13483. case 5:
  13484. this.initialValue = this.inst.angle;
  13485. this.mag = cr.to_radians(this.mag);
  13486. break;
  13487. case 6:
  13488. this.initialValue = this.inst.opacity;
  13489. break;
  13490. case 7:
  13491. this.initialValue = 0;
  13492. break;
  13493. case 8:
  13494. this.initialValue = this.inst.x;
  13495. this.initialValue2 = this.inst.y;
  13496. break;
  13497. default:
  13498. }
  13499. this.lastKnownValue = this.initialValue;
  13500. this.lastKnownValue2 = this.initialValue2
  13501. };
  13502. n.waveFunc = function(e) {
  13503. e = e % r;
  13504. switch (this.wave) {
  13505. case 0:
  13506. return Math.sin(e);
  13507. case 1:
  13508. if (e <= i) return e / i;
  13509. else if (e <= s) return 1 - 2 * (e - i) / Math.PI;
  13510. else return (e - s) / i - 1;
  13511. case 2:
  13512. return 2 * e / r - 1;
  13513. case 3:
  13514. return -2 * e / r + 1;
  13515. case 4:
  13516. return e < Math.PI ? -1 : 1
  13517. }
  13518. return 0
  13519. };
  13520. n.tick = function() {
  13521. var e = this.runtime.getDt(this.inst);
  13522. if (!this.active || e === 0) return;
  13523. if (this.period === 0) this.i = 0;
  13524. else {
  13525. this.i += e / this.period * r;
  13526. this.i = this.i % r
  13527. }
  13528. switch (this.movement) {
  13529. case 0:
  13530. if (this.inst.x !== this.lastKnownValue) this.initialValue += this.inst.x - this.lastKnownValue;
  13531. this.inst.x = this.initialValue + this.waveFunc(this.i) * this.mag;
  13532. this.lastKnownValue = this.inst.x;
  13533. break;
  13534. case 1:
  13535. if (this.inst.y !== this.lastKnownValue) this.initialValue += this.inst.y - this.lastKnownValue;
  13536. this.inst.y = this.initialValue + this.waveFunc(this.i) * this.mag;
  13537. this.lastKnownValue = this.inst.y;
  13538. break;
  13539. case 2:
  13540. this.inst.width = this.initialValue + this.waveFunc(this.i) * this.mag;
  13541. this.inst.height = this.inst.width * this.ratio;
  13542. break;
  13543. case 3:
  13544. this.inst.width = this.initialValue + this.waveFunc(this.i) * this.mag;
  13545. break;
  13546. case 4:
  13547. this.inst.height = this.initialValue + this.waveFunc(this.i) * this.mag;
  13548. break;
  13549. case 5:
  13550. if (this.inst.angle !== this.lastKnownValue) this.initialValue = cr.clamp_angle(this.initialValue + (this.inst.angle - this.lastKnownValue));
  13551. this.inst.angle = cr.clamp_angle(this.initialValue + this.waveFunc(this.i) * this.mag);
  13552. this.lastKnownValue = this.inst.angle;
  13553. break;
  13554. case 6:
  13555. this.inst.opacity = this.initialValue + this.waveFunc(this.i) * this.mag / 100;
  13556. if (this.inst.opacity < 0) this.inst.opacity = 0;
  13557. else if (this.inst.opacity > 1) this.inst.opacity = 1;
  13558. break;
  13559. case 8:
  13560. if (this.inst.x !== this.lastKnownValue) this.initialValue += this.inst.x - this.lastKnownValue;
  13561. if (this.inst.y !== this.lastKnownValue2) this.initialValue2 += this.inst.y - this.lastKnownValue2;
  13562. this.inst.x = this.initialValue + Math.cos(this.inst.angle) * this.waveFunc(this.i) * this.mag;
  13563. this.inst.y = this.initialValue2 + Math.sin(this.inst.angle) * this.waveFunc(this.i) * this.mag;
  13564. this.lastKnownValue = this.inst.x;
  13565. this.lastKnownValue2 = this.inst.y;
  13566. break
  13567. }
  13568. this.inst.set_bbox_changed()
  13569. };
  13570. n.onSpriteFrameChanged = function(e, t) {
  13571. switch (this.movement) {
  13572. case 2:
  13573. this.initialValue *= t.width / e.width;
  13574. this.ratio = t.height / t.width;
  13575. break;
  13576. case 3:
  13577. this.initialValue *= t.width / e.width;
  13578. break;
  13579. case 4:
  13580. this.initialValue *= t.height / e.height;
  13581. break
  13582. }
  13583. };
  13584. o.prototype.IsActive = function() {
  13585. return this.active
  13586. };
  13587. o.prototype.CompareMovement = function(e) {
  13588. return this.movement === e
  13589. };
  13590. o.prototype.ComparePeriod = function(e, t) {
  13591. return cr.do_cmp(this.period, e, t)
  13592. };
  13593. o.prototype.CompareMagnitude = function(e, t) {
  13594. if (this.movement === 5) return cr.do_cmp(this.mag, e, cr.to_radians(t));
  13595. else return cr.do_cmp(this.mag, e, t)
  13596. };
  13597. o.prototype.CompareWave = function(e) {
  13598. return this.wave === e
  13599. };
  13600. e.cnds = new o;
  13601. u.prototype.SetActive = function(e) {
  13602. this.active = e === 1
  13603. };
  13604. u.prototype.SetPeriod = function(e) {
  13605. this.period = e
  13606. };
  13607. u.prototype.SetMagnitude = function(e) {
  13608. this.mag = e;
  13609. if (this.movement === 5) this.mag = cr.to_radians(this.mag)
  13610. };
  13611. u.prototype.SetMovement = function(e) {
  13612. if (this.movement === 5) this.mag = cr.to_degrees(this.mag);
  13613. this.movement = e;
  13614. this.init()
  13615. };
  13616. u.prototype.SetWave = function(e) {
  13617. this.wave = e
  13618. };
  13619. e.acts = new u;
  13620. a.prototype.CyclePosition = function(e) {
  13621. e.set_float(this.i / r)
  13622. };
  13623. a.prototype.Period = function(e) {
  13624. e.set_float(this.period)
  13625. };
  13626. a.prototype.Magnitude = function(e) {
  13627. if (this.movement === 5) e.set_float(cr.to_degrees(this.mag));
  13628. else e.set_float(this.mag)
  13629. };
  13630. a.prototype.Value = function(e) {
  13631. e.set_float(this.waveFunc(this.i) * this.mag)
  13632. };
  13633. e.exps = new a
  13634. })();
  13635. cr.behaviors.custom = function(e) {
  13636. this.runtime = e
  13637. };
  13638. (function() {
  13639. function r(e) {
  13640. if (e === 0) return 0;
  13641. else if (e < 0) return -1;
  13642. else return 1
  13643. }
  13644. function i() {}
  13645. function s() {}
  13646. function o() {}
  13647. var e = cr.behaviors.custom.prototype;
  13648. e.Type = function(e, t) {
  13649. this.behavior = e;
  13650. this.objtype = t;
  13651. this.runtime = e.runtime
  13652. };
  13653. var t = e.Type.prototype;
  13654. t.onCreate = function() {};
  13655. e.Instance = function(e, t) {
  13656. this.type = e;
  13657. this.behavior = e.behavior;
  13658. this.inst = t;
  13659. this.runtime = e.runtime;
  13660. this.dx = 0;
  13661. this.dy = 0;
  13662. this.cancelStep = 0
  13663. };
  13664. var n = e.Instance.prototype;
  13665. n.onCreate = function() {
  13666. this.stepMode = this.properties[0];
  13667. this.pxPerStep = this.properties[1];
  13668. this.enabled = this.properties[2] !== 0
  13669. };
  13670. n.saveToJSON = function() {
  13671. return {
  13672. dx: this.dx,
  13673. dy: this.dy,
  13674. cancelStep: this.cancelStep,
  13675. enabled: this.enabled,
  13676. stepMode: this.stepMode,
  13677. pxPerStep: this.pxPerStep
  13678. }
  13679. };
  13680. n.loadFromJSON = function(e) {
  13681. this.dx = e["dx"];
  13682. this.dy = e["dy"];
  13683. this.cancelStep = e["cancelStep"];
  13684. this.enabled = e["enabled"];
  13685. this.stepMode = e["stepMode"];
  13686. this.pxPerStep = e["pxPerStep"]
  13687. };
  13688. n.getSpeed = function() {
  13689. return Math.sqrt(this.dx * this.dx + this.dy * this.dy)
  13690. };
  13691. n.getAngle = function() {
  13692. return Math.atan2(this.dy, this.dx)
  13693. };
  13694. n.step = function(e, t, n) {
  13695. if (e === 0 && t === 0) return;
  13696. var r = this.inst.x;
  13697. var i = this.inst.y;
  13698. var s, o, u;
  13699. var a = Math.round(Math.sqrt(e * e + t * t) / this.pxPerStep);
  13700. if (a === 0) a = 1;
  13701. var f;
  13702. for (f = 1; f <= a; f++) {
  13703. u = f / a;
  13704. this.inst.x = r + e * u;
  13705. this.inst.y = i + t * u;
  13706. this.inst.set_bbox_changed();
  13707. this.runtime.trigger(n, this.inst);
  13708. if (this.cancelStep === 1) {
  13709. f--;
  13710. u = f / a;
  13711. this.inst.x = r + e * u;
  13712. this.inst.y = i + t * u;
  13713. this.inst.set_bbox_changed();
  13714. return
  13715. } else if (this.cancelStep === 2) {
  13716. return
  13717. }
  13718. }
  13719. };
  13720. n.tick = function() {
  13721. var e = this.runtime.getDt(this.inst);
  13722. var t = this.dx * e;
  13723. var n = this.dy * e;
  13724. var r, i;
  13725. if (this.dx === 0 && this.dy === 0 || !this.enabled) return;
  13726. this.cancelStep = 0;
  13727. if (this.stepMode === 0) {
  13728. this.inst.x += t;
  13729. this.inst.y += n
  13730. } else if (this.stepMode === 1) {
  13731. this.step(t, n, cr.behaviors.custom.prototype.cnds.OnCMStep)
  13732. } else if (this.stepMode === 2) {
  13733. this.step(t, 0, cr.behaviors.custom.prototype.cnds.OnCMHorizStep);
  13734. this.cancelStep = 0;
  13735. this.step(0, n, cr.behaviors.custom.prototype.cnds.OnCMVertStep)
  13736. } else if (this.stepMode === 3) {
  13737. this.step(0, n, cr.behaviors.custom.prototype.cnds.OnCMVertStep);
  13738. this.cancelStep = 0;
  13739. this.step(t, 0, cr.behaviors.custom.prototype.cnds.OnCMHorizStep)
  13740. }
  13741. this.inst.set_bbox_changed()
  13742. };
  13743. i.prototype.IsMoving = function() {
  13744. return this.dx != 0 || this.dy != 0
  13745. };
  13746. i.prototype.CompareSpeed = function(e, t, n) {
  13747. var r;
  13748. switch (e) {
  13749. case 0:
  13750. r = this.getSpeed();
  13751. break;
  13752. case 1:
  13753. r = this.dx;
  13754. break;
  13755. case 2:
  13756. r = this.dy;
  13757. break
  13758. }
  13759. return cr.do_cmp(r, t, n)
  13760. };
  13761. i.prototype.OnCMStep = function() {
  13762. return true
  13763. };
  13764. i.prototype.OnCMHorizStep = function() {
  13765. return true
  13766. };
  13767. i.prototype.OnCMVertStep = function() {
  13768. return true
  13769. };
  13770. e.cnds = new i;
  13771. s.prototype.Stop = function() {
  13772. this.dx = 0;
  13773. this.dy = 0
  13774. };
  13775. s.prototype.Reverse = function(e) {
  13776. switch (e) {
  13777. case 0:
  13778. this.dx *= -1;
  13779. this.dy *= -1;
  13780. break;
  13781. case 1:
  13782. this.dx *= -1;
  13783. break;
  13784. case 2:
  13785. this.dy *= -1;
  13786. break
  13787. }
  13788. };
  13789. s.prototype.SetSpeed = function(e, t) {
  13790. var n;
  13791. switch (e) {
  13792. case 0:
  13793. n = this.getAngle();
  13794. this.dx = Math.cos(n) * t;
  13795. this.dy = Math.sin(n) * t;
  13796. break;
  13797. case 1:
  13798. this.dx = t;
  13799. break;
  13800. case 2:
  13801. this.dy = t;
  13802. break
  13803. }
  13804. };
  13805. s.prototype.Accelerate = function(e, t) {
  13806. var n = this.runtime.getDt(this.inst);
  13807. var r = t * n;
  13808. var i;
  13809. switch (e) {
  13810. case 0:
  13811. i = this.getAngle();
  13812. this.dx += Math.cos(i) * r;
  13813. this.dy += Math.sin(i) * r;
  13814. break;
  13815. case 1:
  13816. this.dx += r;
  13817. break;
  13818. case 2:
  13819. this.dy += r;
  13820. break
  13821. }
  13822. };
  13823. s.prototype.AccelerateAngle = function(e, t) {
  13824. var n = this.runtime.getDt(this.inst);
  13825. var r = e * n;
  13826. var i = cr.to_radians(t);
  13827. this.dx += Math.cos(i) * r;
  13828. this.dy += Math.sin(i) * r
  13829. };
  13830. s.prototype.AcceleratePos = function(e, t, n) {
  13831. var r = this.runtime.getDt(this.inst);
  13832. var i = e * r;
  13833. var s = Math.atan2(n - this.inst.y, t - this.inst.x);
  13834. this.dx += Math.cos(s) * i;
  13835. this.dy += Math.sin(s) * i
  13836. };
  13837. s.prototype.SetAngleOfMotion = function(e) {
  13838. var t = cr.to_radians(e);
  13839. var n = this.getSpeed();
  13840. this.dx = Math.cos(t) * n;
  13841. this.dy = Math.sin(t) * n
  13842. };
  13843. s.prototype.RotateAngleOfMotionClockwise = function(e) {
  13844. var t = this.getAngle() + cr.to_radians(e);
  13845. var n = this.getSpeed();
  13846. this.dx = Math.cos(t) * n;
  13847. this.dy = Math.sin(t) * n
  13848. };
  13849. s.prototype.RotateAngleOfMotionCounterClockwise = function(e) {
  13850. var t = this.getAngle() - cr.to_radians(e);
  13851. var n = this.getSpeed();
  13852. this.dx = Math.cos(t) * n;
  13853. this.dy = Math.sin(t) * n
  13854. };
  13855. s.prototype.StopStepping = function(e) {
  13856. this.cancelStep = e + 1
  13857. };
  13858. s.prototype.PushOutSolid = function(e) {
  13859. var t, n, r;
  13860. switch (e) {
  13861. case 0:
  13862. t = this.getAngle();
  13863. n = Math.cos(t);
  13864. r = Math.sin(t);
  13865. this.runtime.pushOutSolid(this.inst, -n, -r, Math.max(this.getSpeed() * 3, 100));
  13866. break;
  13867. case 1:
  13868. this.runtime.pushOutSolidNearest(this.inst);
  13869. break;
  13870. case 2:
  13871. this.runtime.pushOutSolid(this.inst, 0, -1, Math.max(Math.abs(this.dy) * 3, 100));
  13872. break;
  13873. case 3:
  13874. this.runtime.pushOutSolid(this.inst, 0, 1, Math.max(Math.abs(this.dy) * 3, 100));
  13875. break;
  13876. case 4:
  13877. this.runtime.pushOutSolid(this.inst, -1, 0, Math.max(Math.abs(this.dx) * 3, 100));
  13878. break;
  13879. case 5:
  13880. this.runtime.pushOutSolid(this.inst, 1, 0, Math.max(Math.abs(this.dx) * 3, 100));
  13881. break
  13882. }
  13883. };
  13884. s.prototype.PushOutSolidAngle = function(e) {
  13885. e = cr.to_radians(e);
  13886. var t = Math.cos(e);
  13887. var n = Math.sin(e);
  13888. this.runtime.pushOutSolid(this.inst, t, n, Math.max(this.getSpeed() * 3, 100))
  13889. };
  13890. s.prototype.SetEnabled = function(e) {
  13891. this.enabled = e === 1
  13892. };
  13893. e.acts = new s;
  13894. o.prototype.Speed = function(e) {
  13895. e.set_float(this.getSpeed())
  13896. };
  13897. o.prototype.MovingAngle = function(e) {
  13898. e.set_float(cr.to_degrees(this.getAngle()))
  13899. };
  13900. o.prototype.dx = function(e) {
  13901. e.set_float(this.dx)
  13902. };
  13903. o.prototype.dy = function(e) {
  13904. e.set_float(this.dy)
  13905. };
  13906. e.exps = new o
  13907. })();
  13908. var easeOutBounceArray = [];
  13909. var easeInElasticArray = [];
  13910. var easeOutElasticArray = [];
  13911. var easeInOutElasticArray = [];
  13912. var easeInCircle = [];
  13913. var easeOutCircle = [];
  13914. var easeInOutCircle = [];
  13915. var easeOutBack = [];
  13916. var easeInOutBack = [];
  13917. var litetween_precision = 1e4;
  13918. var updateLimit = 0;
  13919. (function() {
  13920. var t = 1;
  13921. var n = 0;
  13922. var r = 1;
  13923. var i = 0;
  13924. var s = 0;
  13925. var o = 0;
  13926. var u = 0;
  13927. var a = 0;
  13928. for (var f = 0; f <= litetween_precision; f++) {
  13929. u = f / litetween_precision;
  13930. if ((u /= t) < 1 / 2.75) {
  13931. i = r * 7.5625 * u * u + n
  13932. } else if (u < 2 / 2.75) {
  13933. i = r * (7.5625 * (u -= 1.5 / 2.75) * u + .75) + n
  13934. } else if (u < 2.5 / 2.75) {
  13935. i = r * (7.5625 * (u -= 2.25 / 2.75) * u + .9375) + n
  13936. } else {
  13937. i = r * (7.5625 * (u -= 2.625 / 2.75) * u + .984375) + n
  13938. }
  13939. easeOutBounceArray[f] = easeOutBounce(f / litetween_precision, n, r, t);
  13940. u = f / litetween_precision;
  13941. s = 0;
  13942. o = 0;
  13943. if (u == 0) i = n;
  13944. if ((u /= t) == 1) i = n + r;
  13945. if (o == 0) o = t * .3;
  13946. if (s == 0 || s < Math.abs(r)) {
  13947. s = r;
  13948. var a = o / 4
  13949. } else var a = o / (2 * Math.PI) * Math.asin(r / s);
  13950. i = -(s * Math.pow(2, 10 * (u -= 1)) * Math.sin((u * t - a) * 2 * Math.PI / o)) + n;
  13951. easeInElasticArray[f] = i;
  13952. u = f / litetween_precision;
  13953. s = 0;
  13954. o = 0;
  13955. if (u == 0) i = n;
  13956. if ((u /= t) == 1) i = n + r;
  13957. if (o == 0) o = t * .3;
  13958. if (s == 0 || s < Math.abs(r)) {
  13959. s = r;
  13960. var a = o / 4
  13961. } else var a = o / (2 * Math.PI) * Math.asin(r / s);
  13962. i = s * Math.pow(2, -10 * u) * Math.sin((u * t - a) * 2 * Math.PI / o) + r + n;
  13963. easeOutElasticArray[f] = i;
  13964. u = f / litetween_precision;
  13965. s = 0;
  13966. o = 0;
  13967. if (u == 0) i = n;
  13968. if ((u /= t / 2) == 2) i = n + r;
  13969. if (o == 0) o = t * .3 * 1.5;
  13970. if (s == 0 || s < Math.abs(r)) {
  13971. s = r;
  13972. var a = o / 4
  13973. } else var a = o / (2 * Math.PI) * Math.asin(r / s); if (u < 1) i = -.5 * s * Math.pow(2, 10 * (u -= 1)) * Math.sin((u * t - a) * 2 * Math.PI / o) + n;
  13974. else i = s * Math.pow(2, -10 * (u -= 1)) * Math.sin((u * t - a) * 2 * Math.PI / o) * .5 + r + n;
  13975. easeInOutElasticArray[f] = i;
  13976. u = f / litetween_precision;
  13977. easeInCircle[f] = -(Math.sqrt(1 - u * u) - 1);
  13978. u = f / litetween_precision;
  13979. easeOutCircle[f] = Math.sqrt(1 - (u - 1) * (u - 1));
  13980. u = f / litetween_precision;
  13981. if ((u /= t / 2) < 1) i = -r / 2 * (Math.sqrt(1 - u * u) - 1) + n;
  13982. else i = r / 2 * (Math.sqrt(1 - (u -= 2) * u) + 1) + n;
  13983. easeInOutCircle[f] = i;
  13984. u = f / litetween_precision;
  13985. a = 0;
  13986. if (a == 0) a = 1.70158;
  13987. i = r * ((u = u / t - 1) * u * ((a + 1) * u + a) + 1) + n;
  13988. easeOutBack[f] = i;
  13989. u = f / litetween_precision;
  13990. a = 0;
  13991. if (a == 0) a = 1.70158;
  13992. if ((u /= t / 2) < 1) i = r / 2 * u * u * (((a *= 1.525) + 1) * u - a) + n;
  13993. i = r / 2 * ((u -= 2) * u * (((a *= 1.525) + 1) * u + a) + 2) + n;
  13994. easeInOutBack[f] = i
  13995. }
  13996. })();
  13997. var TweenObject = function() {
  13998. var e = function(e, t, n, r, i, s, o) {
  13999. this.name = e;
  14000. this.value = 0;
  14001. this.setInitial(r);
  14002. this.setTarget(i);
  14003. this.easefunc = n;
  14004. this.tweened = t;
  14005. this.duration = s;
  14006. this.progress = 0;
  14007. this.state = 0;
  14008. this.onStart = false;
  14009. this.onEnd = false;
  14010. this.onReverseStart = false;
  14011. this.onReverseEnd = false;
  14012. this.lastKnownValue = 0;
  14013. this.lastKnownValue2 = 0;
  14014. this.enforce = o;
  14015. this.pingpong = 1
  14016. };
  14017. return e
  14018. }();
  14019. (function() {
  14020. TweenObject.prototype = {};
  14021. TweenObject.prototype.setInitial = function(e) {
  14022. this.initialparam1 = parseFloat(e.split(",")[0]);
  14023. this.initialparam2 = parseFloat(e.split(",")[1]);
  14024. this.lastKnownValue = 0;
  14025. this.lastKnownValue2 = 0
  14026. };
  14027. TweenObject.prototype.setTarget = function(e) {
  14028. this.targetparam1 = parseFloat(e.split(",")[0]);
  14029. this.targetparam2 = parseFloat(e.split(",")[1]);
  14030. if (isNaN(this.targetparam2)) this.targetparam2 = this.targetparam1
  14031. };
  14032. TweenObject.prototype.OnTick = function(e) {
  14033. if (this.state === 0) return -1;
  14034. if (this.state === 1) this.progress += e;
  14035. if (this.state === 2) this.progress -= e;
  14036. if (this.state === 3) {
  14037. this.state = 0
  14038. }
  14039. if (this.state === 4) {
  14040. this.progress += e * this.pingpong
  14041. }
  14042. if (this.state === 5) {
  14043. this.progress += e * this.pingpong
  14044. }
  14045. if (this.progress < 0) {
  14046. this.progress = 0;
  14047. if (this.state !== 4) {
  14048. this.state = 0
  14049. } else {
  14050. this.pingpong = 1
  14051. }
  14052. this.onReverseEnd = true;
  14053. return 0
  14054. } else if (this.progress > this.duration) {
  14055. this.progress = this.duration;
  14056. if (this.state === 4) {
  14057. this.pingpong = -1
  14058. } else if (this.state === 5) {
  14059. this.progress = 0
  14060. } else {
  14061. this.state = 0
  14062. }
  14063. this.onEnd = true;
  14064. return 1
  14065. } else {
  14066. var t = easeFunc(this.easefunc, this.progress, 0, 1, this.duration);
  14067. return t
  14068. }
  14069. }
  14070. })();
  14071. cr.behaviors.lunarray_LiteTween = function(e) {
  14072. this.runtime = e
  14073. };
  14074. (function() {
  14075. var e = cr.behaviors.lunarray_LiteTween.prototype;
  14076. e.Type = function(e, t) {
  14077. this.behavior = e;
  14078. this.objtype = t;
  14079. this.runtime = e.runtime
  14080. };
  14081. var t = e.Type.prototype;
  14082. t.onCreate = function() {};
  14083. e.Instance = function(e, t) {
  14084. this.type = e;
  14085. this.behavior = e.behavior;
  14086. this.inst = t;
  14087. this.runtime = e.runtime;
  14088. this.i = 0
  14089. };
  14090. var n = e.Instance.prototype;
  14091. n.onCreate = function() {
  14092. this.active = this.properties[0];
  14093. this.tweened = this.properties[1];
  14094. this.easing = this.properties[2];
  14095. this.target = this.properties[3];
  14096. this.targetmode = this.properties[4];
  14097. if (this.targetmode === 1) this.target = "relative(" + this.target + ")";
  14098. this.duration = this.properties[5];
  14099. this.enforce = this.properties[6] === 1;
  14100. this.inst.value = 0;
  14101. this.tween_list = {};
  14102. this.addToTweenList("default", this.tweened, this.easing, "current", this.target, this.duration, this.enforce);
  14103. if (this.active === 1) this.startTween(0);
  14104. if (this.active === 2) this.startTween(2);
  14105. if (this.active === 3) this.startTween(3)
  14106. };
  14107. n.parseCurrent = function(e, t) {
  14108. if (t === undefined) t = "current";
  14109. var n = trim(t);
  14110. t = trim(t);
  14111. if (t === "current") {
  14112. switch (e) {
  14113. case 0:
  14114. n = this.inst.x + "," + this.inst.y;
  14115. break;
  14116. case 1:
  14117. n = this.inst.width + "," + this.inst.height;
  14118. break;
  14119. case 2:
  14120. n = this.inst.width + "," + this.inst.height;
  14121. break;
  14122. case 3:
  14123. n = this.inst.width + "," + this.inst.height;
  14124. break;
  14125. case 4:
  14126. n = cr.to_degrees(this.inst.angle) + "," + cr.to_degrees(this.inst.angle);
  14127. break;
  14128. case 5:
  14129. n = this.inst.opacity * 100 + "," + this.inst.opacity * 100;
  14130. break;
  14131. case 6:
  14132. n = this.inst.value + "," + this.inst.value;
  14133. break;
  14134. case 7:
  14135. n = this.inst.x + "," + this.inst.y;
  14136. break;
  14137. case 8:
  14138. n = this.inst.x + "," + this.inst.y;
  14139. break;
  14140. default:
  14141. break
  14142. }
  14143. }
  14144. if (t.substring(0, 8) === "relative") {
  14145. var r = t.match(/\((.*?)\)/);
  14146. if (r) {
  14147. var i = parseFloat(r[1].split(",")[0]);
  14148. var s = parseFloat(r[1].split(",")[1])
  14149. }
  14150. if (isNaN(i)) i = 0;
  14151. if (isNaN(s)) s = 0;
  14152. switch (e) {
  14153. case 0:
  14154. n = this.inst.x + i + "," + (this.inst.y + s);
  14155. break;
  14156. case 1:
  14157. n = this.inst.width + i + "," + (this.inst.height + s);
  14158. break;
  14159. case 2:
  14160. n = this.inst.width + i + "," + (this.inst.height + s);
  14161. break;
  14162. case 3:
  14163. n = this.inst.width + i + "," + (this.inst.height + s);
  14164. break;
  14165. case 4:
  14166. n = cr.to_degrees(this.inst.angle) + i + "," + (cr.to_degrees(this.inst.angle) + s);
  14167. break;
  14168. case 5:
  14169. n = this.inst.opacity * 100 + i + "," + (this.inst.opacity * 100 + s);
  14170. break;
  14171. case 6:
  14172. n = this.inst.value + i + "," + this.inst.value + i;
  14173. break;
  14174. case 7:
  14175. n = this.inst.x + i + "," + this.inst.y;
  14176. break;
  14177. case 8:
  14178. n = this.inst.x + "," + (this.inst.y + i);
  14179. break;
  14180. default:
  14181. break
  14182. }
  14183. }
  14184. return n
  14185. };
  14186. n.addToTweenList = function(e, t, n, r, i, s, o) {
  14187. r = this.parseCurrent(t, r);
  14188. i = this.parseCurrent(t, i);
  14189. if (this.tween_list[e] !== undefined) {
  14190. delete this.tween_list[e]
  14191. }
  14192. this.tween_list[e] = new TweenObject(e, t, n, r, i, s, o)
  14193. };
  14194. n.saveToJSON = function() {};
  14195. n.loadFromJSON = function(e) {};
  14196. n.setProgressTo = function(e) {
  14197. if (e > 1) e = 1;
  14198. if (e < 0) e = 0;
  14199. for (var t in this.tween_list) {
  14200. var n = this.tween_list[t];
  14201. n.lastKnownValue = 0;
  14202. n.lastKnownValue2 = 0;
  14203. n.state = 3;
  14204. n.progress = e * n.duration;
  14205. var r = n.OnTick(0);
  14206. this.updateTween(n, r)
  14207. }
  14208. };
  14209. n.startTween = function(e) {
  14210. for (var t in this.tween_list) {
  14211. var n = this.tween_list[t];
  14212. if (e === 0) {
  14213. n.progress = 1e-6;
  14214. n.lastKnownValue = 0;
  14215. n.lastKnownValue2 = 0;
  14216. n.onStart = true;
  14217. n.state = 1
  14218. }
  14219. if (e === 1) {
  14220. n.state = 1
  14221. }
  14222. if (e === 2) {
  14223. n.progress = 1e-6;
  14224. n.lastKnownValue = 0;
  14225. n.lastKnownValue2 = 0;
  14226. n.onStart = true;
  14227. n.state = 4
  14228. }
  14229. if (e === 3) {
  14230. n.progress = 1e-6;
  14231. n.lastKnownValue = 0;
  14232. n.lastKnownValue2 = 0;
  14233. n.onStart = true;
  14234. n.state = 5
  14235. }
  14236. }
  14237. };
  14238. n.stopTween = function(e) {
  14239. for (var t in this.tween_list) {
  14240. var n = this.tween_list[t];
  14241. if (e === 1) n.progress = 0;
  14242. if (e === 2) n.progress = n.duration;
  14243. n.state = 3;
  14244. var r = n.OnTick(0);
  14245. this.updateTween(n, r)
  14246. }
  14247. };
  14248. n.reverseTween = function(e) {
  14249. for (var t in this.tween_list) {
  14250. var n = this.tween_list[t];
  14251. if (e === 1) {
  14252. n.progress = n.duration;
  14253. n.lastKnownValue = 0;
  14254. n.lastKnownValue2 = 0;
  14255. n.onReverseStart = true
  14256. }
  14257. n.state = 2
  14258. }
  14259. };
  14260. n.updateTween = function(e, t) {
  14261. if (e.tweened === 0) {
  14262. if (e.enforce) {
  14263. this.inst.x = e.initialparam1 + (e.targetparam1 - e.initialparam1) * t;
  14264. this.inst.y = e.initialparam2 + (e.targetparam2 - e.initialparam2) * t
  14265. } else {
  14266. this.inst.x += (e.targetparam1 - e.initialparam1) * t - e.lastKnownValue;
  14267. this.inst.y += (e.targetparam2 - e.initialparam2) * t - e.lastKnownValue2;
  14268. e.lastKnownValue = (e.targetparam1 - e.initialparam1) * t;
  14269. e.lastKnownValue2 = (e.targetparam2 - e.initialparam2) * t
  14270. }
  14271. } else if (e.tweened === 1) {
  14272. if (e.enforce) {
  14273. this.inst.width = e.initialparam1 + (e.targetparam1 - e.initialparam1) * t;
  14274. this.inst.height = e.initialparam2 + (e.targetparam2 - e.initialparam2) * t
  14275. } else {
  14276. this.inst.width += (e.targetparam1 - e.initialparam1) * t - e.lastKnownValue;
  14277. this.inst.height += (e.targetparam2 - e.initialparam2) * t - e.lastKnownValue2;
  14278. e.lastKnownValue = (e.targetparam1 - e.initialparam1) * t;
  14279. e.lastKnownValue2 = (e.targetparam2 - e.initialparam2) * t
  14280. }
  14281. } else if (e.tweened === 2) {
  14282. if (e.enforce) {
  14283. this.inst.width = e.initialparam1 + (e.targetparam1 - e.initialparam1) * t
  14284. } else {
  14285. this.inst.width += (e.targetparam1 - e.initialparam1) * t - e.lastKnownValue;
  14286. e.lastKnownValue = (e.targetparam1 - e.initialparam1) * t
  14287. }
  14288. } else if (e.tweened === 3) {
  14289. if (e.enforce) {
  14290. this.inst.height = e.initialparam2 + (e.targetparam2 - e.initialparam2) * t
  14291. } else {
  14292. this.inst.height += (e.targetparam2 - e.initialparam2) * t - e.lastKnownValue2;
  14293. e.lastKnownValue2 = (e.targetparam2 - e.initialparam2) * t
  14294. }
  14295. } else if (e.tweened === 4) {
  14296. if (e.enforce) {
  14297. var n = e.initialparam1 + (e.targetparam1 - e.initialparam1) * t;
  14298. this.inst.angle = cr.clamp_angle(cr.to_radians(n))
  14299. } else {
  14300. var n = (e.targetparam1 - e.initialparam1) * t - e.lastKnownValue;
  14301. this.inst.angle = cr.clamp_angle(this.inst.angle + cr.to_radians(n));
  14302. e.lastKnownValue = (e.targetparam1 - e.initialparam1) * t
  14303. }
  14304. } else if (e.tweened === 5) {
  14305. if (e.enforce) {
  14306. this.inst.opacity = (e.initialparam1 + (e.targetparam1 - e.initialparam1) * t) / 100
  14307. } else {
  14308. this.inst.opacity += ((e.targetparam1 - e.initialparam1) * t - e.lastKnownValue) / 100;
  14309. e.lastKnownValue = (e.targetparam1 - e.initialparam1) * t
  14310. }
  14311. } else if (e.tweened === 6) {
  14312. if (e.enforce) {
  14313. this.inst.value = e.initialparam1 + (e.targetparam1 - e.initialparam1) * t
  14314. } else {
  14315. this.inst.value += (e.targetparam1 - e.initialparam1) * t - e.lastKnownValue;
  14316. e.lastKnownValue = (e.targetparam1 - e.initialparam1) * t
  14317. }
  14318. } else if (e.tweened === 7) {
  14319. if (e.enforce) {
  14320. this.inst.x = e.initialparam1 + (e.targetparam1 - e.initialparam1) * t
  14321. } else {
  14322. this.inst.x += (e.targetparam1 - e.initialparam1) * t - e.lastKnownValue;
  14323. e.lastKnownValue = (e.targetparam1 - e.initialparam1) * t
  14324. }
  14325. } else if (e.tweened === 8) {
  14326. if (e.enforce) {
  14327. this.inst.y = e.initialparam2 + (e.targetparam2 - e.initialparam2) * t
  14328. } else {
  14329. this.inst.y += (e.targetparam2 - e.initialparam2) * t - e.lastKnownValue2;
  14330. e.lastKnownValue2 = (e.targetparam2 - e.initialparam2) * t
  14331. }
  14332. }
  14333. this.inst.set_bbox_changed()
  14334. };
  14335. n.tick = function() {
  14336. var e = this.runtime.getDt(this.inst);
  14337. var t = this.tween_list["default"];
  14338. if (t.state !== 0) {
  14339. if (t.onStart) {
  14340. this.runtime.trigger(cr.behaviors.lunarray_LiteTween.prototype.cnds.OnStart, this.inst);
  14341. t.onStart = false
  14342. }
  14343. if (t.onReverseStart) {
  14344. this.runtime.trigger(cr.behaviors.lunarray_LiteTween.prototype.cnds.OnReverseStart, this.inst);
  14345. t.onReverseStart = false
  14346. }
  14347. var n = t.OnTick(e);
  14348. this.updateTween(t, n);
  14349. if (t.onEnd) {
  14350. this.runtime.trigger(cr.behaviors.lunarray_LiteTween.prototype.cnds.OnEnd, this.inst);
  14351. t.onEnd = false
  14352. }
  14353. if (t.onReverseEnd) {
  14354. this.runtime.trigger(cr.behaviors.lunarray_LiteTween.prototype.cnds.OnReverseEnd, this.inst);
  14355. t.onReverseEnd = false
  14356. }
  14357. }
  14358. };
  14359. e.cnds = {};
  14360. var r = e.cnds;
  14361. r.IsActive = function() {
  14362. return this.tween_list["default"].state !== 0
  14363. };
  14364. r.CompareProgress = function(e, t) {
  14365. var n = this.tween_list["default"];
  14366. return cr.do_cmp(n.progress / n.duration, e, t)
  14367. };
  14368. r.OnStart = function() {
  14369. if (this.tween_list["default"] === undefined) return false;
  14370. return this.tween_list["default"].onStart
  14371. };
  14372. r.OnReverseStart = function() {
  14373. if (this.tween_list["default"] === undefined) return false;
  14374. return this.tween_list["default"].onReverseStart
  14375. };
  14376. r.OnEnd = function() {
  14377. if (this.tween_list["default"] === undefined) return false;
  14378. return this.tween_list["default"].onEnd
  14379. };
  14380. r.OnReverseEnd = function() {
  14381. if (this.tween_list["default"] === undefined) return false;
  14382. return this.tween_list["default"].onReverseEnd
  14383. };
  14384. e.acts = {};
  14385. var i = e.acts;
  14386. i.Start = function(e) {
  14387. this.startTween(e)
  14388. };
  14389. i.Stop = function(e) {
  14390. this.stopTween(e)
  14391. };
  14392. i.Reverse = function(e) {
  14393. this.reverseTween(e)
  14394. };
  14395. i.ProgressTo = function(e) {
  14396. this.setProgressTo(e)
  14397. };
  14398. i.SetDuration = function(e) {
  14399. if (isNaN(e)) return;
  14400. if (e < 0) return;
  14401. if (this.tween_list["default"] === undefined) return;
  14402. this.tween_list["default"].duration = e
  14403. };
  14404. i.SetEnforce = function(e) {
  14405. if (this.tween_list["default"] === undefined) return;
  14406. this.tween_list["default"].enforce = e === 1
  14407. };
  14408. i.SetInitial = function(e) {
  14409. if (this.tween_list["default"] === undefined) return;
  14410. var t = this.parseCurrent(this.tween_list["default"].tweened, e);
  14411. this.tween_list["default"].setInitial(t)
  14412. };
  14413. i.SetTarget = function(e, t, n) {
  14414. if (this.tween_list["default"] === undefined) return;
  14415. if (isNaN(n)) return;
  14416. var r = n + "";
  14417. var i = this.tween_list["default"];
  14418. this.targetmode = t;
  14419. if (t === 1) {
  14420. switch (e) {
  14421. case 0:
  14422. r = this.inst.x + n + "," + i.targetparam2;
  14423. break;
  14424. case 1:
  14425. r = i.targetparam1 + "," + (this.inst.y + n);
  14426. break;
  14427. case 2:
  14428. r = "" + cr.to_degrees(this.inst.angle + cr.to_radians(n));
  14429. break;
  14430. case 3:
  14431. r = "" + this.inst.opacity * 100 + n;
  14432. break;
  14433. case 4:
  14434. r = this.inst.width + n + "," + i.targetparam2;
  14435. break;
  14436. case 5:
  14437. r = i.targetparam1 + "," + (this.inst.height + n);
  14438. break;
  14439. case 6:
  14440. r = n + "," + n;
  14441. break;
  14442. default:
  14443. break
  14444. }
  14445. } else {
  14446. switch (e) {
  14447. case 0:
  14448. r = n + "," + i.targetparam2;
  14449. break;
  14450. case 1:
  14451. r = i.targetparam1 + "," + n;
  14452. break;
  14453. case 2:
  14454. r = n + "," + n;
  14455. break;
  14456. case 3:
  14457. r = n + "," + n;
  14458. break;
  14459. case 4:
  14460. r = n + "," + i.targetparam2;
  14461. break;
  14462. case 5:
  14463. r = i.targetparam1 + "," + n;
  14464. break;
  14465. case 6:
  14466. r = n + "," + n;
  14467. break;
  14468. default:
  14469. break
  14470. }
  14471. }
  14472. var s = this.parseCurrent(this.tween_list["default"].tweened, "current");
  14473. var o = this.parseCurrent(this.tween_list["default"].tweened, r);
  14474. i.setInitial(s);
  14475. i.setTarget(o)
  14476. };
  14477. i.SetTweenedProperty = function(e) {
  14478. if (this.tween_list["default"] === undefined) return;
  14479. this.tween_list["default"].tweened = e
  14480. };
  14481. i.SetEasing = function(e) {
  14482. if (this.tween_list["default"] === undefined) return;
  14483. this.tween_list["default"].easefunc = e
  14484. };
  14485. i.SetValue = function(e) {
  14486. this.inst.value = e
  14487. };
  14488. i.SetParameter = function(e, t, n, r, i) {
  14489. if (this.tween_list["default"] === undefined) {
  14490. this.addToTweenList("default", e, t, initial, n, r, i)
  14491. } else {
  14492. var s = this.tween_list["default"];
  14493. s.tweened = e;
  14494. s.easefunc = t;
  14495. s.setInitial(this.parseCurrent(e, "current"));
  14496. s.setTarget(this.parseCurrent(e, n));
  14497. s.duration = r;
  14498. s.enforce = i === 1
  14499. }
  14500. };
  14501. e.exps = {};
  14502. var s = e.exps;
  14503. s.Progress = function(e) {
  14504. var t = this.tween_list["default"].progress / this.tween_list["default"].duration;
  14505. e.set_float(t)
  14506. };
  14507. s.Duration = function(e) {
  14508. e.set_float(this.tween_list["default"].duration)
  14509. };
  14510. s.Target = function(e) {
  14511. var t = this.tween_list["default"];
  14512. var n = "N/A";
  14513. switch (t.tweened) {
  14514. case 0:
  14515. n = t.targetparam1;
  14516. break;
  14517. case 1:
  14518. n = t.targetparam2;
  14519. break;
  14520. case 2:
  14521. n = t.targetparam1;
  14522. break;
  14523. case 3:
  14524. n = t.targetparam1;
  14525. break;
  14526. case 4:
  14527. n = t.targetparam1;
  14528. break;
  14529. case 5:
  14530. n = t.targetparam2;
  14531. break;
  14532. case 6:
  14533. n = t.targetparam1;
  14534. break;
  14535. default:
  14536. break
  14537. }
  14538. e.set_float(n)
  14539. };
  14540. s.Value = function(e) {
  14541. var t = this.inst.value;
  14542. e.set_float(t)
  14543. }
  14544. })();
  14545. cr.getProjectModel = function() {
  14546. return [null, "StartScreen", [
  14547. [cr.plugins_.Mouse, true, false, false, false, false, false, false, false, false],
  14548. [cr.plugins_.Particles, false, true, true, false, true, true, true, true, true],
  14549. [cr.plugins_.Softgames, true, false, false, false, false, false, false, false, false],
  14550. [cr.plugins_.Sprite, false, true, true, true, true, true, true, true, false],
  14551. [cr.plugins_.Spritefont2, false, true, true, true, true, true, true, true, true],
  14552. [cr.plugins_.Text, false, true, true, true, true, true, true, true, false],
  14553. [cr.plugins_.Touch, true, false, false, false, false, false, false, false, false],
  14554. [cr.plugins_.Browser, true, false, false, false, false, false, false, false, false]
  14555. ],
  14556. [
  14557. ["t0", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14558. ["Default", 5, false, 1, 0, false, 0xbf26330e17ef3, [
  14559. ["images/aboutbtn-sheet0.png", 1725, 0, 0, 104, 59, 1, .5, .508475, [],
  14560. [-.471154, -.457627, 0, -.508475, .471154, -.457627, .490385, -.0169496, .471154, .440678, 0, .491525, -.480769, .457627, -.490385, -.0169496], 0
  14561. ]
  14562. ]]
  14563. ],
  14564. [], false, false, 5208885876211883, []
  14565. ],
  14566. ["t1", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14567. ["Default", 5, false, 1, 0, false, 8146450955332427, [
  14568. ["images/playbtn_square-sheet0.png", 2023, 0, 0, 187, 76, 1, .502674, .5, [],
  14569. [-.481283, -.447368, -.00534782, -.473684, .475936, -.447368, .497326, 0, .475936, .447368, -.00534782, .486842, -.481283, .447368, -.502674, 0], 0
  14570. ]
  14571. ]]
  14572. ],
  14573. [], false, false, 5839598333792561, []
  14574. ],
  14575. ["t2", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14576. ["Default", 5, false, 1, 0, false, 9530490509326564, [
  14577. ["images/pausebtn-sheet0.png", 2077, 0, 0, 52, 52, 1, .519231, .519231, [],
  14578. [-.365385, -.365385, -.0192308, -.519231, .346154, -.384616, .480769, -.0192308, .346154, .346154, -.0192308, .480769, -.384616, .346154, -.519231, -.0192308], 0
  14579. ]
  14580. ]]
  14581. ],
  14582. [], false, false, 8127550894873643, []
  14583. ],
  14584. ["t3", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14585. ["Default", 5, false, 1, 0, false, 9680036336350844, [
  14586. ["images/gotostartscreenbtn-sheet0.png", 2677, 0, 0, 92, 97, 1, .456522, .43299, [],
  14587. [-.282609, -.268042, .0434783, -.381443, .358695, -.257732, .510869, .0618553, .369565, .402062, .0434783, .515464, -.282609, .402062, -.434783, .0618553], 0
  14588. ]
  14589. ]]
  14590. ],
  14591. [], false, false, 0x3ce63d918c408, []
  14592. ],
  14593. ["t4", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14594. ["Default", 5, false, 1, 0, false, 8381725045710814, [
  14595. ["images/playbtn_round-sheet0.png", 2763, 0, 0, 92, 97, 1, .5, .505155, [],
  14596. [-.326087, -.340207, 0, -.453608, .315217, -.329897, .467391, -.0103096, .326087, .329897, 0, .443299, -.326087, .329897, -.478261, -.0103096], 0
  14597. ]
  14598. ]]
  14599. ],
  14600. [], false, false, 9685690679230812, []
  14601. ],
  14602. ["t5", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14603. ["Default", 5, false, 1, 0, false, 452975352209808, [
  14604. ["images/replaybtn-sheet0.png", 3449, 0, 0, 92, 97, 1, .543478, .505155, [],
  14605. [-.369565, -.340207, -.0434783, -.453608, .271739, -.329897, .423913, -.0103096, .282609, .329897, -.0434783, .443299, -.369565, .329897, -.521739, -.0103096], 0
  14606. ]
  14607. ]]
  14608. ],
  14609. [], false, false, 567107003245929, []
  14610. ],
  14611. ["t6", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14612. ["Default", 5, false, 1, 0, false, 6364276854239438, [
  14613. ["images/startscreenbg-sheet0.png", 238084, 0, 0, 320, 480, 1, .5, .5, [],
  14614. [], 1
  14615. ]
  14616. ]]
  14617. ],
  14618. [], false, false, 5756279195113567, []
  14619. ],
  14620. ["t7", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14621. ["Default", 5, false, 1, 0, false, 8270338397967252, [
  14622. ["images/ingamebg-sheet0.png", 181685, 0, 0, 320, 480, 1, .5, .5, [],
  14623. [], 1
  14624. ]
  14625. ]]
  14626. ],
  14627. [], false, false, 0x6f03f24f0373f, []
  14628. ],
  14629. ["t8", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14630. ["Default", 5, false, 1, 0, false, 0x936836f36315a, [
  14631. ["images/tutorial2-sheet0.png", 200756, 0, 0, 320, 480, 1, 0, 0, [],
  14632. [], 1
  14633. ],
  14634. ["images/tutorial2-sheet1.png", 198446, 0, 0, 320, 480, 1, 0, 0, [],
  14635. [], 1
  14636. ]
  14637. ]]
  14638. ],
  14639. [], false, false, 0xbcda3881d3248, []
  14640. ],
  14641. ["t9", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14642. ["Default", 5, false, 1, 0, false, 0x74d899ec3ee24, [
  14643. ["images/tutorial-sheet0.png", 224267, 0, 0, 320, 480, 1, 0, 0, [],
  14644. [], 1
  14645. ],
  14646. ["images/tutorial-sheet1.png", 220546, 0, 0, 320, 480, 1, 0, 0, [],
  14647. [], 1
  14648. ]
  14649. ]]
  14650. ],
  14651. [], false, false, 5702637664950532, []
  14652. ],
  14653. ["t10", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14654. ["Default", 5, false, 1, 0, false, 0x89a209197ed88, [
  14655. ["images/pausescreen-sheet0.png", 9759, 0, 0, 320, 480, 1, 0, 0, [],
  14656. [], 0
  14657. ],
  14658. ["images/pausescreen-sheet1.png", 9895, 0, 0, 320, 480, 1, 0, 0, [],
  14659. [], 0
  14660. ]
  14661. ]]
  14662. ],
  14663. [], false, false, 0x53749ddc258c5, []
  14664. ],
  14665. ["t11", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14666. ["Default", 5, false, 1, 0, false, 328665383089664, [
  14667. ["images/aboutscreen-sheet0.png", 12935, 0, 0, 320, 480, 1, 0, 0, [],
  14668. [], 0
  14669. ],
  14670. ["images/aboutscreen-sheet1.png", 12441, 0, 0, 320, 480, 1, 0, 0, [],
  14671. [], 0
  14672. ]
  14673. ]]
  14674. ],
  14675. [], false, false, 7242083636327699, []
  14676. ],
  14677. ["t12", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14678. ["Default", 5, false, 1, 0, false, 0x8a533c43b0ecd, [
  14679. ["images/gameoverscreen-sheet0.png", 9535, 0, 0, 320, 480, 1, 0, 0, [],
  14680. [], 0
  14681. ],
  14682. ["images/gameoverscreen-sheet1.png", 9518, 0, 0, 320, 480, 1, 0, 0, [],
  14683. [], 0
  14684. ]
  14685. ]]
  14686. ],
  14687. [], false, false, 5207905414052742, []
  14688. ],
  14689. ["t13", cr.plugins_.Sprite, false, [], 2, 0, null, [
  14690. ["Default", 5, false, 1, 0, false, 0xcb3d5b372aefb, [
  14691. ["images/whitescreen-sheet0.png", 244, 0, 0, 320, 480, 1, 0, 0, [],
  14692. [], 4
  14693. ]
  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. ],
  14708. [], false, false, 0x767e0a29bfc1a, []
  14709. ],
  14710. ["t15", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14711. ["Default", 5, false, 1, 0, false, 6589965858475488, [
  14712. ["images/bomb_small-sheet0.png", 2521, 0, 0, 43, 61, 1, .511628, .508197, [],
  14713. [-.139535, -.245902, -.0232559, -.262295, .27907, -.360656, .372093, -.0163937, .209302, .295082, -.0232559, .360655, -.27907, .327869, -.488372, -.0163937], 0
  14714. ]
  14715. ]]
  14716. ],
  14717. [], false, false, 0xbe91bc7f8e75f, []
  14718. ],
  14719. ["t16", cr.plugins_.Sprite, false, [], 1, 0, null, [
  14720. ["Default", 5, false, 1, 0, false, 9942592025634288, [
  14721. ["images/explosion-sheet0.png", 5647, 1, 1, 137, 134, 1, .50365, .507463, [],
  14722. [-.0583946, -.0522387, -.00729966, -.104478, .124087, -.126866, .0948904, -.00746268, .0583944, .0447763, -.00729966, .0373133, -.0364966, .0149253, -.0291966, -.00746268], 0
  14723. ],
  14724. ["images/explosion-sheet0.png", 5647, 139, 1, 137, 134, 1, .50365, .5, [],
  14725. [-.0802917, -.067164, -.00729966, -.156716, .19708, -.19403, .19708, 0, .102189, .097015, -.00729966, .11194, -.109489, .097015, -.124088, 0], 0
  14726. ],
  14727. ["images/explosion-sheet0.png", 5647, 277, 1, 137, 134, 1, .50365, .5, [],
  14728. [-.175183, -.164179, -.00729966, -.231343, .19708, -.19403, .248175, 0, .124087, .119403, -.00729966, .201493, -.160584, .149254, -.240876, 0], 0
  14729. ],
  14730. ["images/explosion-sheet0.png", 5647, 1, 136, 137, 134, 1, .50365, .5, [],
  14731. [-.350365, -.343284, -.00729966, -.485075, .401459, -.402985, .459854, 0, .313868, .313433, -.00729966, .485075, -.335767, .328358, -.416058, 0], 0
  14732. ],
  14733. ["images/explosion-sheet0.png", 5647, 139, 136, 137, 134, 1, .50365, .5, [],
  14734. [.204379, .223881, -.00729966, -.492537, .357664, -.358209, .489051, 0, .328467, .328358, -.00729966, .395522, .211678, -.231343, -.372263, 0], 0
  14735. ],
  14736. ["images/explosion-sheet0.png", 5647, 277, 136, 137, 134, 1, .50365, .5, [],
  14737. [.270073, .291045, .29927, -.298507, .467153, 0, .240876, -.261194, -.277373, 0], 0
  14738. ],
  14739. ["images/explosion-sheet0.png", 5647, 1, 271, 137, 134, 1, .50365, .5, [],
  14740. [.270073, .291045, .29927, -.298507, .467153, 0, .240876, -.261194, -.277373, 0], 0
  14741. ],
  14742. ["images/explosion-sheet0.png", 5647, 139, 271, 137, 134, 1, .50365, .5, [],
  14743. [], 0
  14744. ],
  14745. ["images/explosion-sheet0.png", 5647, 277, 271, 137, 134, 1, .50365, .5, [],
  14746. [], 0
  14747. ]
  14748. ]]
  14749. ],
  14750. [
  14751. ["Fade", cr.behaviors.Fade, 5096540149705603]
  14752. ], false, false, 0xe83af3ce79b0b, []
  14753. ],
  14754. ["t17", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14755. ["Default", 5, false, 1, 0, false, 6974015664332222, [
  14756. ["images/candyhalf_blue-sheet0.png", 2260, 0, 0, 31, 60, 1, 1, .483333, [],
  14757. [-.612903, -.283333, -.516129, -.3, -.354839, -.3, -.032258, .0166667, -.354839, .333334, -.516129, .333334, -.612903, .316667, -.967742, .0166667], 0
  14758. ]
  14759. ]]
  14760. ],
  14761. [], false, false, 0x85f240771fee9, []
  14762. ],
  14763. ["t18", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14764. ["Default", 5, false, 1, 0, false, 0xd7c5541578bcb, [
  14765. ["images/candyhalf_green-sheet0.png", 2815, 0, 0, 39, 76, 1, 1, .5, [],
  14766. [-.564103, -.276316, -.512821, -.302632, -.25641, -.368421, 0, 0, -.205128, .394737, -.512821, .355263, -.615385, .302632, -1, 0], 0
  14767. ]
  14768. ]]
  14769. ],
  14770. [], false, false, 0x60310414c6744, []
  14771. ],
  14772. ["t19", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14773. ["Default", 5, false, 1, 0, false, 0x6c020a91a5264, [
  14774. ["images/candyhalf_purple-sheet0.png", 1983, 0, 0, 25, 48, 1, 1, .520833, [],
  14775. [-.68, -.354166, -.52, -.395833, -.16, -.4375, -.04, -.0208333, -.2, .375, -.64, .291667, -.96, -.0208333], 0
  14776. ]
  14777. ]]
  14778. ],
  14779. [], false, false, 975699212391044, []
  14780. ],
  14781. ["t20", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14782. ["Default", 5, false, 1, 0, false, 0x59fcf6e093ef9, [
  14783. ["images/candy_purple-sheet0.png", 2852, 0, 0, 48, 48, 1, .5, .5, [],
  14784. [-.333333, -.333333, 0, -.479167, .333333, -.333333, .4375, 0, .270833, .270833, 0, .354167, -.270833, .270833, -.416667, 0], 0
  14785. ]
  14786. ]]
  14787. ],
  14788. [], false, false, 8369650883463168, []
  14789. ],
  14790. ["t21", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14791. ["Default", 5, false, 1, 0, false, 6323503275742133, [
  14792. ["images/candy_blue-sheet0.png", 3452, 0, 0, 60, 60, 1, .5, .5, [],
  14793. [-.4, -.4, 0, -.366667, .25, -.25, .416667, 0, .283333, .283333, 0, .4, -.233333, .233333, -.316667, 0], 0
  14794. ]
  14795. ]]
  14796. ],
  14797. [], false, false, 540997275623285, []
  14798. ],
  14799. ["t22", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14800. ["Default", 5, false, 1, 0, false, 9770393067484724, [
  14801. ["images/candy_green-sheet0.png", 4524, 0, 0, 76, 76, 1, .5, .5, [],
  14802. [-.368421, -.368421, 0, -.447368, .328947, -.328947, .473684, 0, .289474, .289474, 0, .342105, -.236842, .236842, -.447368, 0], 0
  14803. ]
  14804. ]]
  14805. ],
  14806. [], false, false, 5323103978308123, []
  14807. ],
  14808. ["t23", cr.plugins_.Sprite, false, [6421634589541215], 1, 0, null, [
  14809. ["Default", 5, false, 1, 0, false, 5430814220914779, [
  14810. ["images/life-sheet0.png", 2410, 0, 0, 71, 55, 1, .507042, .509091, [],
  14811. [-.338028, -.290909, -.0140842, -.454545, .295775, -.254546, .43662, -.0181819, .197183, .109091, -.0140842, .418182, -.183098, .0727271, -.295774, -.0181819], 0
  14812. ]
  14813. ]]
  14814. ],
  14815. [
  14816. ["CustomMovement", cr.behaviors.custom, 891926197686602]
  14817. ], false, false, 0xa1cc1841c6402, []
  14818. ],
  14819. ["t24", cr.plugins_.Sprite, false, [851692599758286], 4, 0, null, [
  14820. ["Default", 5, false, 1, 0, false, 9769720370376208, [
  14821. ["images/life-sheet0.png", 2410, 0, 0, 71, 55, 1, .507042, .509091, [],
  14822. [-.338028, -.290909, -.0140842, -.454545, .295775, -.254546, .43662, -.0181819, .197183, .109091, -.0140842, .418182, -.183098, .0727271, -.295774, -.0181819], 0
  14823. ]
  14824. ]]
  14825. ],
  14826. [
  14827. ["CustomMovement", cr.behaviors.custom, 0x39a192194bb56],
  14828. ["LiteTween", cr.behaviors.lunarray_LiteTween, 0x8fb83cd24d6e],
  14829. ["LiteTween2", cr.behaviors.lunarray_LiteTween, 7787659317162863],
  14830. ["LiteTween3", cr.behaviors.lunarray_LiteTween, 0xe64fa641b096b]
  14831. ], false, false, 0xd6bf614ac12f, []
  14832. ],
  14833. ["t25", cr.plugins_.Sprite, false, [], 1, 0, null, [
  14834. ["Default", 5, false, 1, 0, false, 363864622756435, [
  14835. ["images/fontainstar-sheet0.png", 2733, 0, 0, 52, 50, 1, 1.05769, .78, [],
  14836. [-.557692, -.62, -.384615, -.44, -.26923, -.28, -.26923, 0, -.557692, -.02, -.788461, -.0599999, -.884615, -.28], 0
  14837. ]
  14838. ]]
  14839. ],
  14840. [
  14841. ["CustomMovement", cr.behaviors.custom, 0x59a05936e4a88]
  14842. ], false, false, 8275527515999204, []
  14843. ],
  14844. ["t26", cr.plugins_.Particles, false, [], 0, 0, ["images/fontainstarparticle.png", 278, 0], null, [], false, false, 7457665451351134, []],
  14845. ["t27", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14846. ["Default", 5, false, 1, 0, false, 0x973cd5ed3fbc7, [
  14847. ["images/ingamehud_bg-sheet0.png", 7533, 0, 0, 320, 100, 1, .5, .5, [],
  14848. [0, -.43, .315625, .09, .3, 0, .3, -.14, 0, .11, -.15, 0], 0
  14849. ]
  14850. ]]
  14851. ],
  14852. [], false, false, 7034148364290492, []
  14853. ],
  14854. ["t28", cr.plugins_.Sprite, false, [], 0, 0, null, [
  14855. ["Default", 5, false, 1, 0, false, 807774306128449, [
  14856. ["images/lifebar-sheet0.png", 5840, 1, 85, 53, 41, 1, 0, .463415, [],
  14857. [.0943396, -.341464, .490566, -.268293, .924528, -.365854, .981132, .0243904, .830189, .317073, .490566, .536585, .169811, .317073, .0377358, .0243904], 0
  14858. ],
  14859. ["images/lifebar-sheet0.png", 5840, 1, 43, 77, 41, 1, 0, .463415, [],
  14860. [.0519481, -.365854, .493506, -.439024, .948052, -.365854, .987013, .0243904, .883117, .317073, .493506, .414634, .116883, .317073, .025974, .0243904], 0
  14861. ],
  14862. ["images/lifebar-sheet0.png", 5840, 1, 1, 101, 41, 1, 0, .463415, [],
  14863. [.049505, -.341464, .49505, -.292683, .960396, -.365854, .990099, .0243904, .910891, .317073, .49505, .536585, .0891089, .317073, .019802, .0243904], 0
  14864. ]
  14865. ]]
  14866. ],
  14867. [], false, false, 0xb4c7e4b26dbc5, []
  14868. ],
  14869. ["t29", cr.plugins_.Mouse, false, [], 0, 0, null, null, [], false, false, 0xc1fd9eb08fbb2, [],
  14870. []
  14871. ],
  14872. ["t30", cr.plugins_.Touch, false, [], 0, 0, null, null, [], false, false, 0xaaeeb29fe6633, [],
  14873. [1]
  14874. ],
  14875. ["t31", cr.plugins_.Sprite, false, [], 1, 0, null, [
  14876. ["Default", 5, false, 1, 0, false, 0x48f453c54b81f, [
  14877. ["images/100scorelabel-sheet0.png", 812, 0, 0, 70, 36, 1, .857143, .0277778, [],
  14878. [-.714286, .25, -.357143, .166666, .0285711, .194444, .0857142, .472222, .0142862, .722222, -.357143, .694444, -.728572, .722222, -.842857, .472222], 0
  14879. ]
  14880. ]]
  14881. ],
  14882. [
  14883. ["Fade", cr.behaviors.Fade, 5241465307141786]
  14884. ], false, false, 0x4b52371e2d07c, []
  14885. ],
  14886. ["t32", cr.plugins_.Sprite, false, [], 1, 0, null, [
  14887. ["Default", 5, false, 1, 0, false, 0xcd1e0627b50b5, [
  14888. ["images/10scorelabel-sheet0.png", 644, 0, 0, 51, 34, 1, .901961, .941176, [],
  14889. [-.72549, -.676471, -.411765, -.735294, -.0392158, -.735294, .0588232, -.441176, -.0392158, -.147058, -.764706, -.147058, -.901961, -.441176], 0
  14890. ]
  14891. ]]
  14892. ],
  14893. [
  14894. ["Fade", cr.behaviors.Fade, 4847753738340389]
  14895. ], false, false, 7539418369974563, []
  14896. ],
  14897. ["t33", cr.plugins_.Sprite, false, [], 1, 0, null, [
  14898. ["Default", 5, false, 1, 0, false, 5333891986976473, [
  14899. ["images/30scorelabel-sheet0.png", 699, 0, 0, 56, 36, 1, .375, .972222, [],
  14900. [-.196429, -.694444, .125, -.777778, .482143, -.75, .589286, -.472222, .482143, -.194444, -.232143, -.194444, -.357143, -.472222], 0
  14901. ]
  14902. ]]
  14903. ],
  14904. [
  14905. ["Fade", cr.behaviors.Fade, 9927933799627120]
  14906. ], false, false, 9617569330535946, []
  14907. ],
  14908. ["t34", cr.plugins_.Sprite, false, [], 2, 0, null, [
  14909. ["Default", 5, false, 1, 0, false, 0x938b92d78ba9d, [
  14910. ["images/3xcombolabel-sheet0.png", 1471, 0, 0, 160, 39, 1, .5, .512821, [],
  14911. [-.44375, -.282052, 0, -.179488, .41875, -.179488, .46875, -.0256415, .44375, .25641, -.44375, .25641, -.4625, -.0256415], 0
  14912. ]
  14913. ]]
  14914. ],
  14915. [
  14916. ["Fade", cr.behaviors.Fade, 0x8efae30e12a3e],
  14917. ["Sine", cr.behaviors.Sin, 8326846716478066]
  14918. ], false, false, 507686160308873, []
  14919. ],
  14920. ["t35", cr.plugins_.Sprite, false, [], 2, 0, null, [
  14921. ["Default", 5, false, 1, 0, false, 0x8c12dd267e646, [
  14922. ["images/4xcombolabel-sheet0.png", 1861, 0, 0, 217, 55, 1, .502304, .509091, [],
  14923. [-.447005, -.290909, -.00460812, -.163636, .410138, -.163636, .470046, -.0181819, .43318, .236364, -.43318, .218182, -.497696, -.0181819], 0
  14924. ]
  14925. ]]
  14926. ],
  14927. [
  14928. ["Fade", cr.behaviors.Fade, 7244275268460735],
  14929. ["Sine", cr.behaviors.Sin, 0x3c605e93bd1c9]
  14930. ], false, false, 5996116958732497, []
  14931. ],
  14932. ["t36", cr.plugins_.Sprite, false, [], 1, 0, null, [
  14933. ["Default", 5, false, 1, 0, false, 7804252665775305, [
  14934. ["images/50scorelabel-sheet0.png", 702, 0, 0, 56, 36, 1, .285714, -.0555556, [],
  14935. [-.125, .305556, .214286, .222223, .589286, .25, .678572, .555556, .553572, .805556, -.125, .805556, -.267857, .555556], 0
  14936. ]
  14937. ]]
  14938. ],
  14939. [
  14940. ["Fade", cr.behaviors.Fade, 4799025338321075]
  14941. ], false, false, 9180470322993356, []
  14942. ],
  14943. ["t37", cr.plugins_.Sprite, false, [], 2, 0, null, [
  14944. ["Default", 5, false, 1, 0, false, 0x6a197eab48f4c, [
  14945. ["images/5xcombolabel-sheet0.png", 2375, 0, 0, 267, 64, 1, .501873, .5, [],
  14946. [-.445693, -.265625, -.00374565, -.125, .411985, -.140625, .483146, 0, .449438, .296875, -.00374565, .3125, -.453184, .296875, -.483146, 0], 0
  14947. ]
  14948. ]]
  14949. ],
  14950. [
  14951. ["Fade", cr.behaviors.Fade, 0x5078ac12e5d57],
  14952. ["Sine", cr.behaviors.Sin, 0x39c8e5423f677]
  14953. ], false, false, 0x5b84682b69854, []
  14954. ],
  14955. ["t38", cr.plugins_.Sprite, false, [], 2, 0, null, [
  14956. ["Default", 5, false, 1, 0, false, 0xce8d97781143f, [
  14957. ["images/candyfontainlable-sheet0.png", 3689, 0, 0, 299, 160, 1, .501672, .5, [],
  14958. [-.187291, .0875, -.00334427, -.26875, .220736, .01875, .468228, 0, .384616, .2875, -.00334427, .3125, -.35117, .21875, .38796, 0], 0
  14959. ]
  14960. ]]
  14961. ],
  14962. [
  14963. ["Fade", cr.behaviors.Fade, 9201479989150704],
  14964. ["Sine", cr.behaviors.Sin, 6322809057698405]
  14965. ], false, false, 90459198928289, []
  14966. ],
  14967. ["t39", cr.plugins_.Sprite, false, [], 2, 0, null, [
  14968. ["Default", 5, false, 1, 0, false, 7627941190844073, [
  14969. ["images/supercombolabel-sheet0.png", 7550, 1, 1, 260, 107, 1, .5, .504673, [],
  14970. [-.261538, .0747661, 0, -.364486, .273077, .0467291, .019231, -.00934589, .423077, .308411, 0, .439252, -.426923, .317757, -.034615, -.00934589], 0
  14971. ],
  14972. ["images/supercombolabel-sheet0.png", 7550, 1, 109, 260, 107, 1, .5, .504673, [],
  14973. [-.261538, .0747661, 0, -.364486, .273077, .0467291, .019231, -.00934589, .423077, .308411, 0, .439252, -.426923, .317757, -.034615, -.00934589], 0
  14974. ]
  14975. ]]
  14976. ],
  14977. [
  14978. ["Sine", cr.behaviors.Sin, 6862564799226722],
  14979. ["Fade", cr.behaviors.Fade, 6000449520246343]
  14980. ], false, false, 0x5971f7126d7dd, []
  14981. ],
  14982. ["t40", cr.plugins_.Text, false, [], 0, 0, null, null, [], false, false, 0xfc3f2a1867b8f, []],
  14983. ["t41", cr.plugins_.Text, false, [], 0, 0, null, null, [], false, false, 0xb10852c8fae4b, []],
  14984. ["t42", cr.plugins_.Text, false, [], 0, 0, null, null, [], false, false, 0x560e1d7192b36, []],
  14985. ["t43", cr.plugins_.Text, false, [], 0, 0, null, null, [], false, false, 0x6742389f22114, []],
  14986. ["t44", cr.plugins_.Text, false, [], 0, 0, null, null, [], false, false, 5151779893385322, []],
  14987. ["t45", cr.plugins_.Text, false, [], 0, 0, null, null, [], false, false, 0xdf0e76169c6a2, []],
  14988. ["t46", cr.plugins_.Sprite, false, [], 1, 0, null, [
  14989. ["Default", 5, false, 1, 0, false, 7241622599948809, [
  14990. ["images/juice-sheet0.png", 4479, 0, 0, 451, 452, 1, .501109, .5, [],
  14991. [-.230599, -.230089, -.00221765, -.25, .370288, -.371681, .474501, 0, -.00221765, .329646, -.159646, .159292, -.19734, 0], 0
  14992. ]
  14993. ]]
  14994. ],
  14995. [
  14996. ["Fade", cr.behaviors.Fade, 6948119795969437]
  14997. ], false, false, 9146109515420968, []
  14998. ],
  14999. ["t47", cr.plugins_.Sprite, false, [], 1, 0, null, [
  15000. ["Default", 5, false, 1, 0, false, 0x94161286dd819, [
  15001. ["images/slice-sheet0.png", 816, 0, 0, 64, 64, 1, 0, .5, [],
  15002. [.140625, -.359375, .5, -.5, .859375, -.359375, 1, 0, .859375, .359375, .5, .5, .140625, .359375, 0, 0], 0
  15003. ]
  15004. ]]
  15005. ],
  15006. [
  15007. ["Fade", cr.behaviors.Fade, 5203335805529212]
  15008. ], false, false, 520202982938127, []
  15009. ],
  15010. ["t48", cr.plugins_.Softgames, false, [], 0, 0, null, null, [], false, false, 8621345822828066, [],
  15011. [77]
  15012. ],
  15013. ["t49", cr.plugins_.Spritefont2, false, [], 0, 0, ["images/spritefont.png", 1427, 3], null, [], false, false, 7497840212195717, []],
  15014. ["t50", cr.plugins_.Spritefont2, false, [], 0, 0, ["images/fruitstxtbmp.png", 3591, 0], null, [], false, false, 0x92bb457feeba8, []],
  15015. ["t51", cr.plugins_.Spritefont2, false, [], 0, 0, ["images/fruitstxtbmp.png", 3591, 0], null, [], false, false, 8964434448941994, []],
  15016. ["t52", cr.plugins_.Spritefont2, false, [], 0, 0, ["images/bestscoretxtbmp.png", 2280, 0], null, [], false, false, 761159111345178, []],
  15017. ["t53", cr.plugins_.Spritefont2, false, [], 0, 0, ["images/bestscoretxtbmp.png", 2280, 0], null, [], false, false, 7550819395002681, []],
  15018. ["t54", cr.plugins_.Spritefont2, false, [], 0, 0, ["images/bestscoretxtbmp.png", 2280, 0], null, [], false, false, 8421631644712503, []],
  15019. ["t55", cr.plugins_.Browser, false, [], 0, 0, null, null, [], false, false, 0xdd18963d981d7, [],
  15020. []
  15021. ],
  15022. ["t56", cr.plugins_.Sprite, true, [], 1, 0, null, null, [
  15023. ["CustomMovement2", cr.behaviors.custom, 9968517923918220]
  15024. ], false, false, 8151068894234031, []],
  15025. ["t57", cr.plugins_.Sprite, true, [], 0, 0, null, null, [], false, false, 6624089687897138, []],
  15026. ["t58", cr.plugins_.Sprite, true, [], 0, 0, null, null, [], false, false, 761882580655443, []],
  15027. ["t59", cr.plugins_.Sprite, true, [], 0, 0, null, null, [], false, false, 0x7ede7813d326d, []],
  15028. ["t60", cr.plugins_.Sprite, true, [], 2, 0, null, null, [
  15029. ["VisibilityTween", cr.behaviors.lunarray_LiteTween, 9898873976583244],
  15030. ["InvisibilityTween", cr.behaviors.lunarray_LiteTween, 4895534882965581]
  15031. ], false, false, 7392654326175444, []],
  15032. ["t61", cr.plugins_.Sprite, true, [], 0, 0, null, null, [], false, false, 0x519e239ff9a34, []],
  15033. ["t62", cr.plugins_.Sprite, true, [], 0, 0, null, null, [], false, false, 883931708700071, []]
  15034. ],
  15035. [
  15036. [56, 14, 15, 21, 22, 20, 17, 18, 19, 25, 23],
  15037. [57, 14, 15],
  15038. [58, 21, 22, 20],
  15039. [59, 17, 18, 19],
  15040. [60, 11, 3],
  15041. [61, 31, 32, 33, 34, 35, 36, 37, 38, 39],
  15042. [62, 34, 35, 37, 38, 39]
  15043. ],
  15044. [
  15045. ["GameScreen", 320, 480, false, "Event sheet 1", 5665669193748128, [
  15046. ["BG", 0, 0x82637b5140546, true, [255, 255, 255], false, 1, 1, 1, false, 1, 0, 0, [
  15047. [
  15048. [160, 240, 0, 320, 480, 0, 0, 1, .5, .5, 0, 0, []], 7, 19, [],
  15049. [],
  15050. [0, "Default", 0, 1]
  15051. ],
  15052. [
  15053. [224, -64, 0, 31.9646, 32.0355, 0, 0, 1, .501109, .5, 0, 0, []], 46, 0, [],
  15054. [
  15055. [1, 0, 0, 1, 1]
  15056. ],
  15057. [0, "Default", 0, 1]
  15058. ]
  15059. ],
  15060. []
  15061. ],
  15062. ["Game", 1, 0x89e7f5b533396, true, [255, 255, 255], true, 1, 1, 1, false, 1, 0, 0, [
  15063. [
  15064. [128, -48, 0, 64, 64, 0, 0, 1, 0, .5, 0, 0, []], 47, 3, [],
  15065. [
  15066. [1, 0, 0, .125, 1]
  15067. ],
  15068. [0, "Default", 0, 1]
  15069. ],
  15070. [
  15071. [-400, 48, 0, 250.785, 245.293, 0, 0, 1, .50365, .507463, 0, 0, []], 16, 7, [],
  15072. [
  15073. [1, 0, 0, 1, 1]
  15074. ],
  15075. [0, "Default", 0, 1]
  15076. ],
  15077. [
  15078. [-400, 240, 0, 64, 93, 0, 0, 1, .5, .505376, 0, 0, []], 14, 11, [],
  15079. [
  15080. [0, 5, 1]
  15081. ],
  15082. [0, "Default", 0, 1]
  15083. ],
  15084. [
  15085. [-320, 256, 0, 43, 61, 0, 0, 1, .511628, .508197, 0, 0, []], 15, 13, [],
  15086. [
  15087. [0, 5, 1]
  15088. ],
  15089. [0, "Default", 0, 1]
  15090. ],
  15091. [
  15092. [-464, 448, 0, 60, 60, 0, 0, 1, .5, .5, 0, 0, []], 21, 29, [],
  15093. [
  15094. [0, 5, 1]
  15095. ],
  15096. [0, "Default", 0, 1]
  15097. ],
  15098. [
  15099. [-464, 368, 0, 76, 76, 0, 0, 1, .5, .5, 0, 0, []], 22, 30, [],
  15100. [
  15101. [0, 5, 1]
  15102. ],
  15103. [0, "Default", 0, 1]
  15104. ],
  15105. [
  15106. [-464, 528, 0, 48, 48, 0, 0, 1, .5, .5, 0, 0, []], 20, 31, [],
  15107. [
  15108. [0, 5, 1]
  15109. ],
  15110. [0, "Default", 0, 1]
  15111. ],
  15112. [
  15113. [-352, 448, 0, 31, 60, 0, 0, 1, 1, .483333, 0, 0, []], 17, 32, [],
  15114. [
  15115. [0, 5, 1]
  15116. ],
  15117. [0, "Default", 0, 1]
  15118. ],
  15119. [
  15120. [-384, 368, 0, 39, 76, 0, 0, 1, 1, .5, 0, 0, []], 18, 33, [],
  15121. [
  15122. [0, 5, 1]
  15123. ],
  15124. [0, "Default", 0, 1]
  15125. ],
  15126. [
  15127. [-384, 544, 0, 25, 48, 0, 0, 1, 1, .520833, 0, 0, []], 19, 34, [],
  15128. [
  15129. [0, 5, 1]
  15130. ],
  15131. [0, "Default", 0, 1]
  15132. ],
  15133. [
  15134. [-448, 128, 0, 71, 55, 0, 0, 1, .507042, .509091, 0, 0, []], 24, 2, [
  15135. [0]
  15136. ],
  15137. [
  15138. [0, 5, 1],
  15139. [0, 0, 0, "30, 32", 0, 2, 1],
  15140. [0, 1, 0, "42, 35", 0, 2, 1],
  15141. [0, 4, 0, "360", 0, 2, 1]
  15142. ],
  15143. [0, "Default", 0, 1]
  15144. ],
  15145. [
  15146. [-432, -80, 0, 71, 55, 0, 0, 1, .507042, .509091, 0, 0, []], 23, 1, [
  15147. [0]
  15148. ],
  15149. [
  15150. [0, 5, 1],
  15151. [0, 5, 1]
  15152. ],
  15153. [0, "Default", 0, 1]
  15154. ]
  15155. ],
  15156. []
  15157. ],
  15158. ["HUD", 2, 0xcf69930f08614, true, [255, 255, 255], true, 1, 1, 1, false, 1, 0, 0, [
  15159. [
  15160. [160, 50, 0, 320, 100, 0, 0, 1, .5, .5, 0, 0, []], 27, 27, [],
  15161. [],
  15162. [0, "Default", 0, 1]
  15163. ],
  15164. [
  15165. [16, 64, 0, 128, 32, 0, 0, 1, 0, 0, 0, 0, []], 42, 12, [],
  15166. [],
  15167. ["Text", 0, "12pt Tahoma", "rgb(255,255,255)", 0, 0, 0, 0, 0]
  15168. ],
  15169. [
  15170. [32, -144, 0, 128, 32, 0, 0, 1, 0, 0, 0, 0, []], 43, 15, [],
  15171. [],
  15172. [" ", 0, "14pt Sniglet", "rgb(255,255,255)", 0, 1, 0, 0, 0]
  15173. ],
  15174. [
  15175. [288, 36, 0, 52, 52, 0, 0, 1, .519231, .519231, 0, 0, []], 2, 28, [],
  15176. [],
  15177. [0, "Default", 0, 1]
  15178. ],
  15179. [
  15180. [7, 32, 0, 53, 41, 0, 0, 1, 0, .463415, 0, 0, []], 28, 21, [],
  15181. [],
  15182. [0, "Default", 0, 1]
  15183. ],
  15184. [
  15185. [32, -176, 0, 128, 32, 0, 0, 1, 0, 0, 0, 0, []], 40, 4, [],
  15186. [],
  15187. [" ", 0, "14pt Sniglet", "rgb(255,255,255)", 0, 0, 0, 0, 0]
  15188. ],
  15189. [
  15190. [120, 34, 0, 128, 32, 0, 0, 1, 0, 0, 0, 0, []], 52, 56, [],
  15191. [],
  15192. [16, 16, "ABCDEFGHIJKLMNOPQRSTUVWXYZ!:0123456789", " ", 1, 0, 0, 0, 0, 0, -5, 0]
  15193. ],
  15194. [
  15195. [118, 14, 0, 128, 32, 0, 0, 1, 0, 0, 0, 0, []], 53, 57, [],
  15196. [],
  15197. [16, 16, "ABCDEFGHIJKLMNOPQRSTUVWXYZ!:0123456789", " ", 1, 0, 0, 0, 0, 0, -5, 0]
  15198. ]
  15199. ],
  15200. []
  15201. ],
  15202. ["GamePausedLayer", 3, 8316829967672342, true, [255, 255, 255], true, 1, 1, 1, false, 1, 0, 0, [
  15203. [
  15204. [272, 496, 0, 320, 480, 0, 0, 1, 0, 0, 0, 0, []], 10, 35, [],
  15205. [],
  15206. [0, "Default", 0, 1]
  15207. ],
  15208. [
  15209. [-928, 176, 0, 320, 480, 0, 0, 1, 0, 0, 0, 0, []], 9, 23, [],
  15210. [],
  15211. [0, "Default", 0, 1]
  15212. ],
  15213. [
  15214. [656, 496, 0, 320, 480, 0, 0, 1, 0, 0, 0, 0, []], 8, 36, [],
  15215. [],
  15216. [0, "Default", 0, 1]
  15217. ],
  15218. [
  15219. [-80, 512, 0, 320, 480, 0, 0, 1, 0, 0, 0, 0, []], 12, 22, [],
  15220. [],
  15221. [0, "Default", 0, 1]
  15222. ],
  15223. [
  15224. [-208, 816, 0, 95, 95, 0, 0, 1, .456522, .43299, 0, 0, []], 3, 26, [],
  15225. [
  15226. [0, 5, 0, "100,100", 0, 2.5, 1],
  15227. [0, 0, 23, "100,100", 0, 2.5, 1]
  15228. ],
  15229. [0, "Default", 0, 1]
  15230. ],
  15231. [
  15232. [-176, 944, 0, 92, 97, 0, 0, 1, .543478, .505155, 0, 0, []], 5, 25, [],
  15233. [],
  15234. [0, "Default", 0, 1]
  15235. ],
  15236. [
  15237. [-160, 672, 0, 92, 97, 0, 0, 1, .5, .505155, 0, 0, []], 4, 37, [],
  15238. [],
  15239. [0, "Default", 0, 1]
  15240. ],
  15241. [
  15242. [-448, 672, 0, 224, 48, 0, 0, 1, 0, 0, 0, 0, []], 41, 45, [],
  15243. [],
  15244. ["Candies:", 0, "20pt Sniglet", "rgb(255,255,255)", 0, 0, 0, 0, 0]
  15245. ],
  15246. [
  15247. [-416, 720, 0, 224, 48, 0, 0, 1, 0, 0, 0, 0, []], 44, 47, [],
  15248. [],
  15249. [" ", 0, "20pt Sniglet", "rgb(255,255,255)", 0, 0, 0, 0, 0]
  15250. ],
  15251. [
  15252. [-51, 694, 0, 240, 32, 0, 0, 1, 0, 0, 0, 0, []], 50, 54, [],
  15253. [],
  15254. [23, 23, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!:0123456789", " ", 1, 0, 0, 0, 0, 0, -5, 0]
  15255. ],
  15256. [
  15257. [-49, 728, 0, 240, 32, 0, 0, 1, 0, 0, 0, 0, []], 51, 55, [],
  15258. [],
  15259. [23, 23, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!:0123456789", " ", 1, 0, 0, 0, 0, 0, -5, 0]
  15260. ]
  15261. ],
  15262. []
  15263. ],
  15264. ["TopLayer", 4, 4747559956664143, true, [255, 255, 255], true, 1, 1, 1, false, 1, 0, 0, [
  15265. [
  15266. [528, -80, 0, 160, 39, 0, 0, 1, .5, .512821, 0, 0, []], 34, 6, [],
  15267. [
  15268. [1, 0, 0, 1.5, 1],
  15269. [1, 1, 0, .5, 0, 0, 0, 20, 0]
  15270. ],
  15271. [0, "Default", 0, 1]
  15272. ],
  15273. [
  15274. [576, 0, 0, 217, 55, 0, 0, 1, .502304, .509091, 0, 0, []], 35, 8, [],
  15275. [
  15276. [1, 0, 0, 1.5, 1],
  15277. [1, 1, 0, .4, 0, 0, 0, 35, 0]
  15278. ],
  15279. [0, "Default", 0, 1]
  15280. ],
  15281. [
  15282. [560, 112, 0, 267, 64, 0, 0, 1, .501873, .5, 0, 0, []], 37, 14, [],
  15283. [
  15284. [1, 0, 0, 1.5, 1],
  15285. [1, 1, 0, .4, 0, 0, 0, 50, 0]
  15286. ],
  15287. [0, "Default", 0, 1]
  15288. ],
  15289. [
  15290. [528, 240, 0, 299, 160, 0, 0, 1, .501672, .5, 0, 0, []], 38, 16, [],
  15291. [
  15292. [1, 0, 0, 2.5, 1],
  15293. [1, 1, 0, 1, 0, 0, 0, 70, 0]
  15294. ],
  15295. [0, "Default", 0, 1]
  15296. ],
  15297. [
  15298. [416, 384, 0, 51, 34, 0, 0, 1, .901961, .941176, 0, 0, []], 32, 20, [],
  15299. [
  15300. [1, 0, 0, 1, 1]
  15301. ],
  15302. [0, "Default", 0, 1]
  15303. ],
  15304. [
  15305. [512, 368, 0, 56, 36, 0, 0, 1, .375, .972222, 0, 0, []], 33, 39, [],
  15306. [
  15307. [1, 0, 0, 1, 1]
  15308. ],
  15309. [0, "Default", 0, 1]
  15310. ],
  15311. [
  15312. [416, 416, 0, 56, 36, 0, 0, 1, .285714, -.0555556, 0, 0, []], 36, 40, [],
  15313. [
  15314. [1, 0, 0, 1, 1]
  15315. ],
  15316. [0, "Default", 0, 1]
  15317. ],
  15318. [
  15319. [528, 448, 0, 70, 36, 0, 0, 1, .857143, .0277778, 0, 0, []], 31, 41, [],
  15320. [
  15321. [1, 0, 0, 1, 1]
  15322. ],
  15323. [0, "Default", 0, 1]
  15324. ],
  15325. [
  15326. [-864, 720, 0, 320, 480, 0, 0, 1, 0, 0, 0, 0, []], 13, 42, [],
  15327. [
  15328. [0, 5, 0, "100", 0, .3, 1],
  15329. [0, 5, 0, "0", 0, .3, 1]
  15330. ],
  15331. [0, "Default", 0, 1]
  15332. ],
  15333. [
  15334. [-144, 384, 0, 48.9506, 47.0679, 0, 0, 1, 1.05769, .78, 0, 0, []], 25, 49, [],
  15335. [
  15336. [0, 5, 1],
  15337. [0, 5, 1]
  15338. ],
  15339. [0, "Default", 0, 1]
  15340. ],
  15341. [
  15342. [-240, 480, 0, 128, 128, 0, 0, 1, 0, .5, 0, 0, []], 26, 50, [],
  15343. [],
  15344. [20, 360, 1, 200, 20, 100, 0, 0, 0, 0, 0, 0, -150, 20, 0, 1200, 0, 0, 1]
  15345. ],
  15346. [
  15347. [864, 48, 0, 260, 107, 0, 0, 1, .5, .504673, 0, 0, []], 39, 51, [],
  15348. [
  15349. [1, 1, 0, .3, 0, 0, 0, 50, 0],
  15350. [1, 0, 0, 1.5, 1]
  15351. ],
  15352. [0, "Default", 0, 1]
  15353. ]
  15354. ],
  15355. []
  15356. ]
  15357. ],
  15358. [],
  15359. []
  15360. ],
  15361. ["StartScreen", 320, 480, false, "Event sheet 2", 9901377344593672, [
  15362. ["BG", 0, 761795434122473, true, [255, 255, 255], false, 1, 1, 1, false, 1, 0, 0, [
  15363. [
  15364. [160, 240, 0, 320, 480, 0, 0, 1, .5, .5, 0, 0, []], 6, 9, [],
  15365. [],
  15366. [0, "Default", 0, 1]
  15367. ]
  15368. ],
  15369. []
  15370. ],
  15371. ["Btns", 1, 0x72ef05d2785c6, true, [255, 255, 255], true, 1, 1, 1, false, 1, 0, 0, [
  15372. [
  15373. [161, 343, 0, 187, 76, 0, 0, 1, .502674, .5, 0, 0, []], 1, 17, [],
  15374. [],
  15375. [0, "Default", 0, 1]
  15376. ],
  15377. [
  15378. [163, 418, 0, 104, 59, 0, 0, 1, .5, .508475, 0, 0, []], 0, 18, [],
  15379. [],
  15380. [0, "Default", 0, 1]
  15381. ],
  15382. [
  15383. [417, 292, 0, 131, 29, 0, 0, 1, .5, .5, 0, 0, []], 45, 52, [],
  15384. [],
  15385. [" 0", 0, "16pt Sniglet", "rgb(255,255,255)", 1, 1, 1, 0, 0]
  15386. ],
  15387. [
  15388. [-193, 84.5, 0, 128, 48, 0, 0, 1, .5, .5, 0, 0, []], 43, 43, [],
  15389. [],
  15390. [" ", 0, "bold 14pt Tahoma", "rgb(255,255,255)", 0, 1, 1, 0, 0]
  15391. ],
  15392. [
  15393. [-257, 51.5, 0, 112, 32, 0, 0, 1, 0, 0, 0, 0, []], 40, 44, [],
  15394. [],
  15395. ["Text", 0, "14pt Arial", "rgb(255,255,255)", 0, 0, 0, 0, 0]
  15396. ],
  15397. [
  15398. [-267, 105, 0, 224, 48, 0, 0, 1, 0, 0, 0, 0, []], 41, 46, [],
  15399. [],
  15400. ["Candies:", 0, "20pt Sniglet", "rgb(255,255,255)", 0, 0, 0, 0, 0]
  15401. ],
  15402. [
  15403. [-268, 133, 0, 224, 48, 0, 0, 1, 0, 0, 0, 0, []], 44, 48, [],
  15404. [],
  15405. [" ", 0, "20pt Sniglet", "rgb(255,255,255)", 0, 0, 0, 0, 0]
  15406. ],
  15407. [
  15408. [90, 255, 0, 144, 32, 0, 0, 1, 0, 0, 0, 0, []], 54, 58, [],
  15409. [],
  15410. [16, 16, "ABCDEFGHIJKLMNOPQRSTUVWXYZ!:0123456789", " 0", 1, 0, 1, 0, 0, 0, -5, 0]
  15411. ]
  15412. ],
  15413. []
  15414. ],
  15415. ["Layer 0", 2, 0x73b50bd8aee9f, true, [255, 255, 255], true, 1, 1, 1, false, 1, 0, 0, [
  15416. [
  15417. [0, 0, 0, 320, 480, 0, 0, 1, 0, 0, 0, 0, []], 11, 24, [],
  15418. [
  15419. [0, 5, 0, "100", 0, .3, 1],
  15420. [0, 5, 0, "0", 0, .3, 1]
  15421. ],
  15422. [0, "Default", 0, 1]
  15423. ],
  15424. [
  15425. [249, 367, 0, 92, 97, 0, 0, 1, .456522, .43299, 0, 0, []], 3, 38, [],
  15426. [
  15427. [0, 5, 0, "100", 0, .3, 1],
  15428. [0, 5, 0, "0", 0, .3, 1]
  15429. ],
  15430. [0, "Default", 0, 1]
  15431. ]
  15432. ],
  15433. []
  15434. ]
  15435. ],
  15436. [],
  15437. []
  15438. ]
  15439. ],
  15440. [
  15441. ["Event sheet 1", [
  15442. [1, "BestScore", 0, 0, false, false, 4832072822553496, false],
  15443. [1, "GlobalSpeed", 0, 700, false, false, 0xb30f804de6ef7, false],
  15444. [1, "CurrTut", 0, 0, false, false, 5499465144956748, false],
  15445. [1, "TutCompleted", 0, 0, false, false, 0x4f2951a156125, false],
  15446. [1, "SlomoIsActive", 0, 0, false, false, 0xbfc20cbf55359, false],
  15447. [1, "CandyFontainIsActiveFor", 0, 0, false, false, 6398686650565134, false],
  15448. [1, "CandyFontainIsActive", 0, 0, false, false, 5583264838436099, false],
  15449. [1, "SpawnCandiesTimeRandOffset", 0, .4, false, false, 9067514685283420, false],
  15450. [1, "SpawnCandiesTime", 0, .3, false, false, 0xce9fc0fedb569, false],
  15451. [1, "CuttedAtRaw", 0, 0, false, false, 748545829960142, false],
  15452. [1, "MouseBeenReleaseSinceLastCut", 0, 0, false, false, 7958792258545028, false],
  15453. [1, "ElapsedSinceLastCut", 0, 0, false, false, 0x89782b7e4e60b, false],
  15454. [1, "Score", 0, 0, false, false, 8401123337034218, false],
  15455. [1, "Lives", 0, 2, false, false, 5255261810854884, false],
  15456. [1, "GameIsPaused", 0, 1, false, false, 9167813209970552, false],
  15457. [1, "Candies_Amount", 0, 0, false, false, 9344722873491312, false],
  15458. [1, "Slice_Initial_X", 0, 0, false, false, 0x7b1848a51e511, false],
  15459. [1, "Slice_Initial_Y", 0, 0, false, false, 0x62d49eb6733d8, false],
  15460. [0, null, false, null, 0x53d8437754bbf, [
  15461. [-1, cr.system_object.prototype.cnds.OnLayoutStart, null, 1, false, false, false, 7937539008198606, false]
  15462. ],
  15463. [
  15464. [42, cr.plugins_.Text.prototype.acts.Destroy, null, 6820424415321544, false],
  15465. [47, cr.plugins_.Sprite.prototype.acts.Destroy, null, 6721067476553631, false],
  15466. [46, cr.plugins_.Sprite.prototype.acts.Destroy, null, 9788157872917526, false],
  15467. [56, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x8ed39869d485c, false],
  15468. [61, cr.plugins_.Sprite.prototype.acts.Destroy, null, 5994690632022597, false],
  15469. [24, cr.plugins_.Sprite.prototype.acts.Destroy, null, 5828823102253303, false],
  15470. [10, cr.plugins_.Sprite.prototype.acts.Destroy, null, 5396774202371632, false],
  15471. [12, cr.plugins_.Sprite.prototype.acts.Destroy, null, 8650605350340585, false],
  15472. [9, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x7dc642a93417e, false],
  15473. [8, cr.plugins_.Sprite.prototype.acts.Destroy, null, 7273147720164038, false],
  15474. [3, cr.plugins_.Sprite.prototype.acts.Destroy, null, 4806718719820633, false],
  15475. [4, cr.plugins_.Sprite.prototype.acts.Destroy, null, 9485122755064738, false],
  15476. [5, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x713a6eb074c4e, false],
  15477. [26, cr.plugins_.Particles.prototype.acts.Destroy, null, 0x5f905b126cec, false],
  15478. [41, cr.plugins_.Text.prototype.acts.Destroy, null, 0xa99a129bfc4bd, false],
  15479. [44, cr.plugins_.Text.prototype.acts.Destroy, null, 0x9cf7ba15df2f, false],
  15480. [40, cr.plugins_.Text.prototype.acts.Destroy, null, 8392435797807625, false],
  15481. [43, cr.plugins_.Text.prototype.acts.Destroy, null, 0xa636ffc9414b8, false],
  15482. [-1, cr.system_object.prototype.acts.SetVar, null, 0xdcb5af0b42127, false, [
  15483. [11, "Lives"],
  15484. [7, [0, 2]]
  15485. ]],
  15486. [-1, cr.system_object.prototype.acts.SetVar, null, 8163631624987311, false, [
  15487. [11, "GameIsPaused"],
  15488. [7, [0, 1]]
  15489. ]],
  15490. [-1, cr.system_object.prototype.acts.SetVar, null, 53407383322061, false, [
  15491. [11, "SlomoIsActive"],
  15492. [7, [0, 0]]
  15493. ]],
  15494. [-1, cr.system_object.prototype.acts.SetVar, null, 0x9f01a59a06f59, false, [
  15495. [11, "MouseBeenReleaseSinceLastCut"],
  15496. [7, [0, 0]]
  15497. ]],
  15498. [-1, cr.system_object.prototype.acts.SetVar, null, 0x436d7dfffe751, false, [
  15499. [11, "Candies_Amount"],
  15500. [7, [0, 0]]
  15501. ]],
  15502. [-1, cr.system_object.prototype.acts.SetVar, null, 6653766910556768, false, [
  15503. [11, "Score"],
  15504. [7, [0, 0]]
  15505. ]],
  15506. [-1, cr.system_object.prototype.acts.SetVar, null, 5973102120616778, false, [
  15507. [11, "CandyFontainIsActive"],
  15508. [7, [0, 0]]
  15509. ]],
  15510. [-1, cr.system_object.prototype.acts.SetVar, null, 768932538247207, false, [
  15511. [11, "CandyFontainIsActiveFor"],
  15512. [7, [0, 0]]
  15513. ]],
  15514. [-1, cr.system_object.prototype.acts.SetVar, null, 0x82bc1ef910490, false, [
  15515. [11, "BombsSpawnDelayDone"],
  15516. [7, [0, 0]]
  15517. ]],
  15518. [28, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 6433770912432973, false, [
  15519. [0, [23, "Lives"]]
  15520. ]],
  15521. [28, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 0xc9fab59ebe5e1, false],
  15522. [-1, cr.system_object.prototype.acts.CreateObject, null, 4938086548461428, false, [
  15523. [4, 13],
  15524. [5, [0, 4]],
  15525. [0, [0, 0]],
  15526. [0, [0, 0]]
  15527. ]],
  15528. [13, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 5226120715309349, false, [
  15529. [0, [0, 0]]
  15530. ]],
  15531. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "start", 484118958134746, false, [
  15532. [3, 0]
  15533. ]],
  15534. [-1, cr.system_object.prototype.acts.Wait, null, 0x7583da686d227, false, [
  15535. [0, [1, .3]]
  15536. ]],
  15537. [28, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 8123885592019209, false, [
  15538. [3, 0]
  15539. ]],
  15540. [27, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 4956083032955628, false, [
  15541. [3, 0]
  15542. ]],
  15543. [2, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 0x8574f496f86d, false, [
  15544. [3, 0]
  15545. ]],
  15546. [43, cr.plugins_.Text.prototype.acts.SetText, null, 7160192311664218, false, [
  15547. [7, [10, [2, " "],
  15548. [23, "Score"]
  15549. ]]
  15550. ]],
  15551. [40, cr.plugins_.Text.prototype.acts.SetText, null, 0x3a53f13c93834, false, [
  15552. [7, [10, [2, "BEST:"],
  15553. [23, "BestScore"]
  15554. ]]
  15555. ]],
  15556. [53, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 7504492535028863, false, [
  15557. [3, 0]
  15558. ]],
  15559. [52, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 0xabd15c40a2bb3, false, [
  15560. [3, 0]
  15561. ]],
  15562. [52, cr.plugins_.Spritefont2.prototype.acts.MoveToLayer, null, 0x916dab0f5b1c5, false, [
  15563. [5, [0, 2]]
  15564. ]]
  15565. ],
  15566. [
  15567. [0, null, false, null, 9177726973297438, [
  15568. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x8a2f67d5f5278, false, [
  15569. [11, "LANG"],
  15570. [8, 0],
  15571. [7, [2, "es"]]
  15572. ]]
  15573. ],
  15574. [
  15575. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 61351661703021, false, [
  15576. [7, [10, [2, "PUNTAJE:"],
  15577. [23, "Score"]
  15578. ]]
  15579. ]],
  15580. [52, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0xd5fca1dd55e46, false, [
  15581. [7, [10, [2, "MEJOR:"],
  15582. [23, "BestScore"]
  15583. ]]
  15584. ]]
  15585. ]
  15586. ],
  15587. [0, null, false, null, 0x4efb0c3cb5e52, [
  15588. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0xd1025aa094ccd, false]
  15589. ],
  15590. [
  15591. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 5319411021060142, false, [
  15592. [7, [10, [2, " "],
  15593. [23, "Score"]
  15594. ]]
  15595. ]],
  15596. [52, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 8509529196405516, false, [
  15597. [7, [10, [2, "BEST:"],
  15598. [23, "BestScore"]
  15599. ]]
  15600. ]]
  15601. ]
  15602. ],
  15603. [0, null, false, null, 8646791937225954, [],
  15604. [
  15605. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "stop", 0x3dfc1ba9aefbb, false, [
  15606. [3, 0]
  15607. ]],
  15608. [-1, cr.system_object.prototype.acts.Wait, null, 9094988347303514, false, [
  15609. [0, [1, .3]]
  15610. ]],
  15611. [13, cr.plugins_.Sprite.prototype.acts.Destroy, null, 513240665258939, false]
  15612. ]
  15613. ],
  15614. [0, null, false, null, 5263994670658141, [
  15615. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xa28db10ad5a10, false, [
  15616. [11, "TutCompleted"],
  15617. [8, 0],
  15618. [7, [0, 0]]
  15619. ]]
  15620. ],
  15621. [
  15622. [-1, cr.system_object.prototype.acts.CreateObject, null, 6577262119012411, false, [
  15623. [4, 9],
  15624. [5, [0, 3]],
  15625. [0, [0, 0]],
  15626. [0, [0, 0]]
  15627. ]],
  15628. [-1, cr.system_object.prototype.acts.CreateObject, null, 7309097208893702, false, [
  15629. [4, 4],
  15630. [5, [0, 3]],
  15631. [0, [0, 261]],
  15632. [0, [0, 406]]
  15633. ]],
  15634. [-1, cr.system_object.prototype.acts.SetVar, null, 9532472212888396, false, [
  15635. [11, "CurrTut"],
  15636. [7, [0, 1]]
  15637. ]]
  15638. ],
  15639. [
  15640. [0, null, false, null, 0x4c2ed533a415d, [
  15641. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xc8889c20c2cb7, false, [
  15642. [11, "LANG"],
  15643. [8, 0],
  15644. [7, [2, "es"]]
  15645. ]]
  15646. ],
  15647. [
  15648. [9, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 8474617350745324, false, [
  15649. [0, [0, 1]]
  15650. ]],
  15651. [9, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 0xf33de6f3b1193, false]
  15652. ]
  15653. ],
  15654. [0, null, false, null, 0xafd1f0e303c53, [
  15655. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0xb199b8b3f45d8, false]
  15656. ],
  15657. [
  15658. [9, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 664527044844423, false, [
  15659. [0, [0, 0]]
  15660. ]],
  15661. [9, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 0x40ecd79e50661, false]
  15662. ]
  15663. ]
  15664. ]
  15665. ],
  15666. [0, null, false, null, 5748467303303985, [
  15667. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 335608760556832, false]
  15668. ],
  15669. [
  15670. [-1, cr.system_object.prototype.acts.SetVar, null, 9427173312487962, false, [
  15671. [11, "GameIsPaused"],
  15672. [7, [0, 0]]
  15673. ]],
  15674. [28, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 0x5bd95ba3e0b00, false, [
  15675. [3, 1]
  15676. ]],
  15677. [27, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 6247536423914716, false, [
  15678. [3, 1]
  15679. ]],
  15680. [2, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 0x51bd23be2c9bf, false, [
  15681. [3, 1]
  15682. ]],
  15683. [53, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 9964285891037172, false, [
  15684. [3, 1]
  15685. ]],
  15686. [52, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 8086180617662733, false, [
  15687. [3, 1]
  15688. ]]
  15689. ]
  15690. ]
  15691. ]
  15692. ],
  15693. [0, null, false, null, 0xc09f96ec06043, [
  15694. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xea49c9cec4c25, false, [
  15695. [11, "GameIsPaused"],
  15696. [8, 0],
  15697. [7, [0, 1]]
  15698. ]],
  15699. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 6785094147308014, false, [
  15700. [11, "TutCompleted"],
  15701. [8, 0],
  15702. [7, [0, 0]]
  15703. ]]
  15704. ],
  15705. [],
  15706. [
  15707. [0, null, true, null, 7754857444298257, [
  15708. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 5705305411994146, false, [
  15709. [3, 0],
  15710. [3, 0],
  15711. [4, 4]
  15712. ]],
  15713. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 6931394593831444, false, [
  15714. [4, 4]
  15715. ]]
  15716. ],
  15717. [],
  15718. [
  15719. [0, null, false, null, 0x5237c6604fe16, [
  15720. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 9727643922105048, false, [
  15721. [11, "CurrTut"],
  15722. [8, 0],
  15723. [7, [0, 1]]
  15724. ]]
  15725. ],
  15726. [
  15727. [-1, cr.system_object.prototype.acts.CreateObject, null, 9536321484925048, false, [
  15728. [4, 13],
  15729. [5, [0, 4]],
  15730. [0, [0, 0]],
  15731. [0, [0, 0]]
  15732. ]],
  15733. [13, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 7519477562270497, false, [
  15734. [0, [0, 0]]
  15735. ]],
  15736. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "start", 4709208812830006, false, [
  15737. [3, 0]
  15738. ]],
  15739. [-1, cr.system_object.prototype.acts.Wait, null, 0xddd06cee07017, false, [
  15740. [0, [1, .3]]
  15741. ]],
  15742. [9, cr.plugins_.Sprite.prototype.acts.Destroy, null, 6595099038870162, false],
  15743. [-1, cr.system_object.prototype.acts.CreateObject, null, 9768807131793894, false, [
  15744. [4, 8],
  15745. [5, [0, 3]],
  15746. [0, [0, 0]],
  15747. [0, [0, 0]]
  15748. ]],
  15749. [4, cr.plugins_.Sprite.prototype.acts.MoveToTop, null, 0xba0e3cef0b16e, false],
  15750. [-1, cr.system_object.prototype.acts.SetVar, null, 7246427662669753, false, [
  15751. [11, "CurrTut"],
  15752. [7, [0, 2]]
  15753. ]]
  15754. ],
  15755. [
  15756. [0, null, false, null, 6638191455274088, [
  15757. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 6908829644078461, false, [
  15758. [11, "LANG"],
  15759. [8, 0],
  15760. [7, [2, "es"]]
  15761. ]]
  15762. ],
  15763. [
  15764. [8, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 7334354187499932, false, [
  15765. [0, [0, 1]]
  15766. ]],
  15767. [8, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 0xfda8a48cf0447, false]
  15768. ]
  15769. ],
  15770. [0, null, false, null, 0xa6bb8ffd38a9a, [
  15771. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 9884926316486848, false]
  15772. ],
  15773. [
  15774. [8, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 0x670947c01f000, false, [
  15775. [0, [0, 0]]
  15776. ]],
  15777. [8, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 0xfdaddc8616e6c, false]
  15778. ]
  15779. ],
  15780. [0, null, false, null, 5846927071827348, [],
  15781. [
  15782. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "stop", 0x741db25ab56c5, false, [
  15783. [3, 0]
  15784. ]],
  15785. [-1, cr.system_object.prototype.acts.Wait, null, 0x9e43f4def8ac9, false, [
  15786. [0, [1, .3]]
  15787. ]],
  15788. [13, cr.plugins_.Sprite.prototype.acts.Destroy, null, 9066729937577848, false]
  15789. ]
  15790. ]
  15791. ]
  15792. ],
  15793. [0, null, false, null, 5316683306948174, [
  15794. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 5508104589819223, false]
  15795. ],
  15796. [
  15797. [-1, cr.system_object.prototype.acts.CreateObject, null, 6106535191894293, false, [
  15798. [4, 13],
  15799. [5, [0, 4]],
  15800. [0, [0, 0]],
  15801. [0, [0, 0]]
  15802. ]],
  15803. [13, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 6212239803941915, false, [
  15804. [0, [0, 0]]
  15805. ]],
  15806. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "start", 7669512908206894, false, [
  15807. [3, 0]
  15808. ]],
  15809. [-1, cr.system_object.prototype.acts.Wait, null, 4808646555820771, false, [
  15810. [0, [1, .3]]
  15811. ]],
  15812. [8, cr.plugins_.Sprite.prototype.acts.Destroy, null, 5394579556213709, false],
  15813. [4, cr.plugins_.Sprite.prototype.acts.Destroy, null, 4543648318239956, false],
  15814. [-1, cr.system_object.prototype.acts.SetVar, null, 0x7fcb814e1ebbd, false, [
  15815. [11, "TutCompleted"],
  15816. [7, [0, 1]]
  15817. ]],
  15818. [-1, cr.system_object.prototype.acts.SetVar, null, 8483754784208008, false, [
  15819. [11, "CurrTut"],
  15820. [7, [0, 2222]]
  15821. ]],
  15822. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "stop", 0xab80646a5503b, false, [
  15823. [3, 0]
  15824. ]],
  15825. [-1, cr.system_object.prototype.acts.Wait, null, 5024560761266645, false, [
  15826. [0, [1, .3]]
  15827. ]],
  15828. [13, cr.plugins_.Sprite.prototype.acts.Destroy, null, 5942891480654481, false],
  15829. [-1, cr.system_object.prototype.acts.SetVar, null, 0x8fb327c69d527, false, [
  15830. [11, "GameIsPaused"],
  15831. [7, [0, 0]]
  15832. ]],
  15833. [28, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 6309081197139418, false, [
  15834. [3, 1]
  15835. ]],
  15836. [27, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 5069813109175883, false, [
  15837. [3, 1]
  15838. ]],
  15839. [2, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 6097726730871108, false, [
  15840. [3, 1]
  15841. ]],
  15842. [53, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 7706081591061075, false, [
  15843. [3, 1]
  15844. ]],
  15845. [52, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 8610312043259726, false, [
  15846. [3, 1]
  15847. ]]
  15848. ]
  15849. ]
  15850. ]
  15851. ]
  15852. ]
  15853. ],
  15854. [0, null, false, null, 8235732786874766, [
  15855. [29, cr.plugins_.Mouse.prototype.cnds.OnClick, null, 1, false, false, false, 0xd0e4cb162b829, false, [
  15856. [3, 0],
  15857. [3, 0]
  15858. ]]
  15859. ],
  15860. [
  15861. [-1, cr.system_object.prototype.acts.SetVar, null, 9483357908559128, false, [
  15862. [11, "Slice_Initial_X"],
  15863. [7, [20, 29, cr.plugins_.Mouse.prototype.exps.X, false, null]]
  15864. ]],
  15865. [-1, cr.system_object.prototype.acts.SetVar, null, 9269527787097844, false, [
  15866. [11, "Slice_Initial_Y"],
  15867. [7, [20, 29, cr.plugins_.Mouse.prototype.exps.Y, false, null]]
  15868. ]]
  15869. ]
  15870. ],
  15871. [0, null, false, null, 8680557405443485, [
  15872. [30, cr.plugins_.Touch.prototype.cnds.OnTouchStart, null, 1, false, false, false, 0xc7d4bf982b854, false]
  15873. ],
  15874. [
  15875. [-1, cr.system_object.prototype.acts.SetVar, null, 8078319301548373, false, [
  15876. [11, "Slice_Initial_X"],
  15877. [7, [20, 30, cr.plugins_.Touch.prototype.exps.X, false, null, [
  15878. [2, "BG"]
  15879. ]]]
  15880. ]],
  15881. [-1, cr.system_object.prototype.acts.SetVar, null, 0x62795083a709d, false, [
  15882. [11, "Slice_Initial_Y"],
  15883. [7, [20, 30, cr.plugins_.Touch.prototype.exps.Y, false, null, [
  15884. [2, "BG"]
  15885. ]]]
  15886. ]]
  15887. ]
  15888. ],
  15889. [0, null, false, null, 0xe38e6ddc38ebf, [
  15890. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 6593874809610883, false, [
  15891. [11, "GameIsPaused"],
  15892. [8, 1],
  15893. [7, [0, 1]]
  15894. ]],
  15895. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5842275606662821, false, [
  15896. [11, "SlomoIsActive"],
  15897. [8, 1],
  15898. [7, [0, 1]]
  15899. ]],
  15900. [30, cr.plugins_.Touch.prototype.cnds.IsTouchingObject, null, 0, false, true, false, 8511768616888706, false, [
  15901. [4, 2]
  15902. ]],
  15903. [30, cr.plugins_.Touch.prototype.cnds.IsTouchingObject, null, 0, false, true, false, 579743555049803, false, [
  15904. [4, 4]
  15905. ]]
  15906. ],
  15907. [],
  15908. [
  15909. [0, null, false, null, 0xb189256bc695, [
  15910. [29, cr.plugins_.Mouse.prototype.cnds.IsButtonDown, null, 0, false, false, false, 9208063196246088, false, [
  15911. [3, 0]
  15912. ]]
  15913. ],
  15914. [
  15915. [-1, cr.system_object.prototype.acts.CreateObject, null, 9738788806048504, false, [
  15916. [4, 47],
  15917. [5, [0, 0]],
  15918. [0, [23, "Slice_Initial_X"]],
  15919. [0, [23, "Slice_Initial_Y"]]
  15920. ]],
  15921. [47, cr.plugins_.Sprite.prototype.acts.SetWidth, null, 7110760503873639, false, [
  15922. [0, [19, cr.system_object.prototype.exps.distance, [
  15923. [23, "Slice_Initial_X"],
  15924. [23, "Slice_Initial_Y"],
  15925. [20, 29, cr.plugins_.Mouse.prototype.exps.X, false, null],
  15926. [20, 29, cr.plugins_.Mouse.prototype.exps.Y, false, null]
  15927. ]]]
  15928. ]],
  15929. [47, cr.plugins_.Sprite.prototype.acts.SetHeight, null, 0x75d1529ee3286, false, [
  15930. [0, [7, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  15931. [0, 8]
  15932. ]]
  15933. ]],
  15934. [47, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 0xc7f5aecb05db2, false, [
  15935. [0, [19, cr.system_object.prototype.exps.angle, [
  15936. [23, "Slice_Initial_X"],
  15937. [23, "Slice_Initial_Y"],
  15938. [20, 29, cr.plugins_.Mouse.prototype.exps.X, false, null],
  15939. [20, 29, cr.plugins_.Mouse.prototype.exps.Y, false, null]
  15940. ]]]
  15941. ]],
  15942. [-1, cr.system_object.prototype.acts.SetVar, null, 934323766011749, false, [
  15943. [11, "Slice_Initial_X"],
  15944. [7, [20, 29, cr.plugins_.Mouse.prototype.exps.X, false, null]]
  15945. ]],
  15946. [-1, cr.system_object.prototype.acts.SetVar, null, 379194305975312, false, [
  15947. [11, "Slice_Initial_Y"],
  15948. [7, [20, 29, cr.plugins_.Mouse.prototype.exps.Y, false, null]]
  15949. ]]
  15950. ]
  15951. ],
  15952. [0, null, false, null, 0xcf6f74c69e48d, [
  15953. [30, cr.plugins_.Touch.prototype.cnds.IsInTouch, null, 0, false, false, false, 7498367476290705, false]
  15954. ],
  15955. [
  15956. [-1, cr.system_object.prototype.acts.CreateObject, null, 0x55839224d198b, false, [
  15957. [4, 47],
  15958. [5, [0, 0]],
  15959. [0, [23, "Slice_Initial_X"]],
  15960. [0, [23, "Slice_Initial_Y"]]
  15961. ]],
  15962. [47, cr.plugins_.Sprite.prototype.acts.SetWidth, null, 0x7fa879901cd8f, false, [
  15963. [0, [19, cr.system_object.prototype.exps.distance, [
  15964. [23, "Slice_Initial_X"],
  15965. [23, "Slice_Initial_Y"],
  15966. [20, 30, cr.plugins_.Touch.prototype.exps.X, false, null, [
  15967. [2, "BG"]
  15968. ]],
  15969. [20, 30, cr.plugins_.Touch.prototype.exps.Y, false, null, [
  15970. [2, "BG"]
  15971. ]]
  15972. ]]]
  15973. ]],
  15974. [47, cr.plugins_.Sprite.prototype.acts.SetHeight, null, 0x6637246bd9853, false, [
  15975. [0, [7, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  15976. [0, 8]
  15977. ]]
  15978. ]],
  15979. [47, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 0x4a0d70d6a2215, false, [
  15980. [0, [19, cr.system_object.prototype.exps.angle, [
  15981. [23, "Slice_Initial_X"],
  15982. [23, "Slice_Initial_Y"],
  15983. [20, 30, cr.plugins_.Touch.prototype.exps.X, false, null, [
  15984. [2, "BG"]
  15985. ]],
  15986. [20, 30, cr.plugins_.Touch.prototype.exps.Y, false, null, [
  15987. [2, "BG"]
  15988. ]]
  15989. ]]]
  15990. ]],
  15991. [-1, cr.system_object.prototype.acts.SetVar, null, 724601221004615, false, [
  15992. [11, "Slice_Initial_X"],
  15993. [7, [20, 30, cr.plugins_.Touch.prototype.exps.X, false, null, [
  15994. [2, "BG"]
  15995. ]]]
  15996. ]],
  15997. [-1, cr.system_object.prototype.acts.SetVar, null, 6654926442820032, false, [
  15998. [11, "Slice_Initial_Y"],
  15999. [7, [20, 30, cr.plugins_.Touch.prototype.exps.Y, false, null, [
  16000. [2, "BG"]
  16001. ]]]
  16002. ]]
  16003. ]
  16004. ]
  16005. ]
  16006. ],
  16007. [1, "RandNum", 0, 0, false, false, 6319539101115461, false],
  16008. [0, null, false, null, 0x8623668b9050c, [
  16009. [-1, cr.system_object.prototype.cnds.Every, null, 0, false, false, false, 8651764072200669, false, [
  16010. [0, [4, [23, "SpawnCandiesTime"],
  16011. [19, cr.system_object.prototype.exps.random, [
  16012. [23, "SpawnCandiesTimeRandOffset"]
  16013. ]]
  16014. ]]
  16015. ]],
  16016. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5388746387251387, false, [
  16017. [11, "GameIsPaused"],
  16018. [8, 1],
  16019. [7, [0, 1]]
  16020. ]]
  16021. ],
  16022. [
  16023. [-1, cr.system_object.prototype.acts.SetVar, null, 0x68850639a6d8d, false, [
  16024. [11, "RandNum"],
  16025. [7, [19, cr.system_object.prototype.exps.random, [
  16026. [0, 100]
  16027. ]]]
  16028. ]]
  16029. ],
  16030. [
  16031. [0, null, false, null, 5990317030899022, [
  16032. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x972bca0cfd750, false, [
  16033. [11, "RandNum"],
  16034. [8, 2],
  16035. [7, [0, 50]]
  16036. ]]
  16037. ],
  16038. [
  16039. [-1, cr.system_object.prototype.acts.CreateObject, null, 6151099206952308, false, [
  16040. [4, 22],
  16041. [5, [0, 1]],
  16042. [0, [4, [6, [20, 22, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16043. [0, 2]
  16044. ],
  16045. [19, cr.system_object.prototype.exps.random, [
  16046. [5, [19, cr.system_object.prototype.exps.layoutwidth],
  16047. [6, [20, 22, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16048. [0, 4]
  16049. ]
  16050. ]
  16051. ]]
  16052. ]],
  16053. [0, [4, [19, cr.system_object.prototype.exps.layoutheight],
  16054. [7, [20, 22, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16055. [0, 2]
  16056. ]
  16057. ]]
  16058. ]],
  16059. [22, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 0x93ff32960af06, false, [
  16060. [3, 0],
  16061. [0, [3, [23, "GlobalSpeed"]]]
  16062. ]],
  16063. [22, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 6286482505286708, false, [
  16064. [0, [5, [1, -84.375],
  16065. [19, cr.system_object.prototype.exps.random, [
  16066. [1, 11.25]
  16067. ]]
  16068. ]]
  16069. ]]
  16070. ]
  16071. ],
  16072. [0, null, false, null, 5274143938247925, [
  16073. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 9648577030902012, false, [
  16074. [11, "RandNum"],
  16075. [8, 4],
  16076. [7, [0, 50]]
  16077. ]],
  16078. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xe9322495b31a4, false, [
  16079. [11, "RandNum"],
  16080. [8, 2],
  16081. [7, [0, 80]]
  16082. ]]
  16083. ],
  16084. [
  16085. [-1, cr.system_object.prototype.acts.CreateObject, null, 6812113892113561, false, [
  16086. [4, 21],
  16087. [5, [0, 1]],
  16088. [0, [4, [6, [20, 21, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16089. [0, 2]
  16090. ],
  16091. [19, cr.system_object.prototype.exps.random, [
  16092. [5, [19, cr.system_object.prototype.exps.layoutwidth],
  16093. [6, [20, 21, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16094. [0, 4]
  16095. ]
  16096. ]
  16097. ]]
  16098. ]],
  16099. [0, [4, [19, cr.system_object.prototype.exps.layoutheight],
  16100. [7, [20, 21, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16101. [0, 2]
  16102. ]
  16103. ]]
  16104. ]],
  16105. [21, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 9385652354809988, false, [
  16106. [3, 0],
  16107. [0, [3, [23, "GlobalSpeed"]]]
  16108. ]],
  16109. [21, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 6505644210799675, false, [
  16110. [0, [5, [1, -84.375],
  16111. [19, cr.system_object.prototype.exps.random, [
  16112. [1, 11.25]
  16113. ]]
  16114. ]]
  16115. ]]
  16116. ]
  16117. ],
  16118. [0, null, false, null, 890021948424506, [
  16119. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 7769282182095803, false, [
  16120. [11, "RandNum"],
  16121. [8, 4],
  16122. [7, [0, 80]]
  16123. ]]
  16124. ],
  16125. [
  16126. [-1, cr.system_object.prototype.acts.CreateObject, null, 4744652261489706, false, [
  16127. [4, 20],
  16128. [5, [0, 1]],
  16129. [0, [4, [6, [20, 20, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16130. [0, 2]
  16131. ],
  16132. [19, cr.system_object.prototype.exps.random, [
  16133. [5, [19, cr.system_object.prototype.exps.layoutwidth],
  16134. [6, [20, 20, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16135. [0, 4]
  16136. ]
  16137. ]
  16138. ]]
  16139. ]],
  16140. [0, [4, [19, cr.system_object.prototype.exps.layoutheight],
  16141. [7, [20, 20, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16142. [0, 2]
  16143. ]
  16144. ]]
  16145. ]],
  16146. [20, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 0x804bec5ad8823, false, [
  16147. [3, 0],
  16148. [0, [3, [23, "GlobalSpeed"]]]
  16149. ]],
  16150. [20, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 9181057484873316, false, [
  16151. [0, [5, [1, -84.375],
  16152. [19, cr.system_object.prototype.exps.random, [
  16153. [1, 11.25]
  16154. ]]
  16155. ]]
  16156. ]]
  16157. ]
  16158. ]
  16159. ]
  16160. ],
  16161. [1, "BombsSpawnDelayDone", 0, 0, false, false, 863431158169603, false],
  16162. [0, null, false, null, 873855346871748, [
  16163. [-1, cr.system_object.prototype.cnds.Every, null, 0, false, false, false, 5420250466619507, false, [
  16164. [0, [0, 10]]
  16165. ]],
  16166. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xf022262cc77ff, false, [
  16167. [11, "BombsSpawnDelayDone"],
  16168. [8, 0],
  16169. [7, [0, 0]]
  16170. ]],
  16171. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5866031539419033, false, [
  16172. [11, "GameIsPaused"],
  16173. [8, 1],
  16174. [7, [0, 1]]
  16175. ]]
  16176. ],
  16177. [
  16178. [-1, cr.system_object.prototype.acts.SetVar, null, 6529857721984496, false, [
  16179. [11, "BombsSpawnDelayDone"],
  16180. [7, [0, 1]]
  16181. ]]
  16182. ]
  16183. ],
  16184. [0, null, false, null, 0xf8dfa6e71f112, [
  16185. [-1, cr.system_object.prototype.cnds.Every, null, 0, false, false, false, 0xb4b15c8c10c14, false, [
  16186. [0, [4, [0, 2],
  16187. [19, cr.system_object.prototype.exps.random, [
  16188. [0, 2]
  16189. ]]
  16190. ]]
  16191. ]],
  16192. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 8778999704927417, false, [
  16193. [11, "GameIsPaused"],
  16194. [8, 1],
  16195. [7, [0, 1]]
  16196. ]],
  16197. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 6497079813489304, false, [
  16198. [11, "CandyFontainIsActive"],
  16199. [8, 1],
  16200. [7, [0, 1]]
  16201. ]],
  16202. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 7884178814557775, false, [
  16203. [11, "BombsSpawnDelayDone"],
  16204. [8, 0],
  16205. [7, [0, 1]]
  16206. ]]
  16207. ],
  16208. [
  16209. [-1, cr.system_object.prototype.acts.CreateObject, null, 8775271545487426, false, [
  16210. [4, 14],
  16211. [5, [0, 1]],
  16212. [0, [4, [6, [20, 14, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16213. [0, 2]
  16214. ],
  16215. [19, cr.system_object.prototype.exps.random, [
  16216. [5, [19, cr.system_object.prototype.exps.layoutwidth],
  16217. [6, [20, 14, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16218. [0, 4]
  16219. ]
  16220. ]
  16221. ]]
  16222. ]],
  16223. [0, [4, [19, cr.system_object.prototype.exps.layoutheight],
  16224. [7, [20, 14, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16225. [0, 2]
  16226. ]
  16227. ]]
  16228. ]],
  16229. [14, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 4706481182765618, false, [
  16230. [3, 0],
  16231. [0, [3, [23, "GlobalSpeed"]]]
  16232. ]],
  16233. [14, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 5835107900658018, false, [
  16234. [0, [5, [1, -84.375],
  16235. [19, cr.system_object.prototype.exps.random, [
  16236. [1, 11.25]
  16237. ]]
  16238. ]]
  16239. ]],
  16240. [14, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 506182958675356, false, [
  16241. [0, [19, cr.system_object.prototype.exps.random, [
  16242. [0, 360]
  16243. ]]]
  16244. ]]
  16245. ]
  16246. ],
  16247. [0, null, false, null, 0xf3ebb1247cfdb, [
  16248. [-1, cr.system_object.prototype.cnds.Every, null, 0, false, false, false, 6432816878591915, false, [
  16249. [0, [4, [0, 3],
  16250. [19, cr.system_object.prototype.exps.random, [
  16251. [0, 1]
  16252. ]]
  16253. ]]
  16254. ]],
  16255. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5885991440510994, false, [
  16256. [11, "GameIsPaused"],
  16257. [8, 1],
  16258. [7, [0, 1]]
  16259. ]],
  16260. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xe6e617f3e6eee, false, [
  16261. [11, "CandyFontainIsActive"],
  16262. [8, 1],
  16263. [7, [0, 1]]
  16264. ]],
  16265. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x3a0b9e6bd05c5, false, [
  16266. [11, "BombsSpawnDelayDone"],
  16267. [8, 0],
  16268. [7, [0, 1]]
  16269. ]]
  16270. ],
  16271. [
  16272. [-1, cr.system_object.prototype.acts.CreateObject, null, 5155768844322383, false, [
  16273. [4, 15],
  16274. [5, [0, 1]],
  16275. [0, [4, [6, [20, 15, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16276. [0, 2]
  16277. ],
  16278. [19, cr.system_object.prototype.exps.random, [
  16279. [5, [19, cr.system_object.prototype.exps.layoutwidth],
  16280. [6, [20, 15, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16281. [0, 4]
  16282. ]
  16283. ]
  16284. ]]
  16285. ]],
  16286. [0, [4, [19, cr.system_object.prototype.exps.layoutheight],
  16287. [7, [20, 15, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16288. [0, 2]
  16289. ]
  16290. ]]
  16291. ]],
  16292. [15, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 5807331087783236, false, [
  16293. [3, 0],
  16294. [0, [3, [23, "GlobalSpeed"]]]
  16295. ]],
  16296. [15, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 5098467506986848, false, [
  16297. [0, [5, [1, -84.375],
  16298. [19, cr.system_object.prototype.exps.random, [
  16299. [1, 11.25]
  16300. ]]
  16301. ]]
  16302. ]],
  16303. [15, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 0x3d9c32263a1e1, false, [
  16304. [0, [19, cr.system_object.prototype.exps.random, [
  16305. [0, 360]
  16306. ]]]
  16307. ]]
  16308. ]
  16309. ],
  16310. [0, null, false, null, 9169659291704680, [
  16311. [-1, cr.system_object.prototype.cnds.Every, null, 0, false, false, false, 8100831553995254, false, [
  16312. [0, [4, [0, 3],
  16313. [19, cr.system_object.prototype.exps.random, [
  16314. [0, 7]
  16315. ]]
  16316. ]]
  16317. ]],
  16318. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 9845164406988056, false, [
  16319. [11, "GameIsPaused"],
  16320. [8, 1],
  16321. [7, [0, 1]]
  16322. ]],
  16323. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xfa47b5ba78089, false, [
  16324. [11, "Lives"],
  16325. [8, 2],
  16326. [7, [0, 2]]
  16327. ]]
  16328. ],
  16329. [
  16330. [-1, cr.system_object.prototype.acts.CreateObject, null, 796941462357713, false, [
  16331. [4, 23],
  16332. [5, [0, 1]],
  16333. [0, [4, [6, [20, 23, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16334. [0, 2]
  16335. ],
  16336. [19, cr.system_object.prototype.exps.random, [
  16337. [5, [19, cr.system_object.prototype.exps.layoutwidth],
  16338. [6, [20, 23, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16339. [0, 4]
  16340. ]
  16341. ]
  16342. ]]
  16343. ]],
  16344. [0, [4, [19, cr.system_object.prototype.exps.layoutheight],
  16345. [7, [20, 23, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16346. [0, 2]
  16347. ]
  16348. ]]
  16349. ]],
  16350. [23, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement", 0x5dc8493b23fe7, false, [
  16351. [3, 0],
  16352. [0, [3, [23, "GlobalSpeed"]]]
  16353. ]],
  16354. [23, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement", 7553820718100702, false, [
  16355. [0, [5, [1, -84.375],
  16356. [19, cr.system_object.prototype.exps.random, [
  16357. [1, 11.25]
  16358. ]]
  16359. ]]
  16360. ]],
  16361. [23, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 0x96bffb3a6a41d, false, [
  16362. [0, [19, cr.system_object.prototype.exps.random, [
  16363. [0, 360]
  16364. ]]]
  16365. ]]
  16366. ]
  16367. ],
  16368. [0, null, false, null, 8265547815813638, [
  16369. [-1, cr.system_object.prototype.cnds.Every, null, 0, false, false, false, 8123537674051468, false, [
  16370. [0, [4, [0, 20],
  16371. [19, cr.system_object.prototype.exps.random, [
  16372. [0, 20]
  16373. ]]
  16374. ]]
  16375. ]],
  16376. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x78d338a203ef0, false, [
  16377. [11, "GameIsPaused"],
  16378. [8, 1],
  16379. [7, [0, 1]]
  16380. ]]
  16381. ],
  16382. [
  16383. [-1, cr.system_object.prototype.acts.CreateObject, null, 5608397315525246, false, [
  16384. [4, 25],
  16385. [5, [0, 1]],
  16386. [0, [4, [6, [20, 25, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16387. [0, 2]
  16388. ],
  16389. [19, cr.system_object.prototype.exps.random, [
  16390. [5, [19, cr.system_object.prototype.exps.layoutwidth],
  16391. [6, [20, 25, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16392. [0, 4]
  16393. ]
  16394. ]
  16395. ]]
  16396. ]],
  16397. [0, [4, [19, cr.system_object.prototype.exps.layoutheight],
  16398. [7, [20, 25, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16399. [0, 2]
  16400. ]
  16401. ]]
  16402. ]],
  16403. [25, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement", 6348895249535183, false, [
  16404. [3, 0],
  16405. [0, [3, [23, "GlobalSpeed"]]]
  16406. ]],
  16407. [25, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement", 0x6c6ec4417a193, false, [
  16408. [0, [5, [1, -84.375],
  16409. [19, cr.system_object.prototype.exps.random, [
  16410. [1, 11.25]
  16411. ]]
  16412. ]]
  16413. ]],
  16414. [25, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 0x783f65624c83a, false, [
  16415. [0, [19, cr.system_object.prototype.exps.random, [
  16416. [0, 360]
  16417. ]]]
  16418. ]]
  16419. ]
  16420. ],
  16421. [0, null, false, null, 6383413249098096, [
  16422. [-1, cr.system_object.prototype.cnds.EveryTick, null, 0, false, false, false, 5161049479181053, false]
  16423. ],
  16424. [],
  16425. [
  16426. [0, null, false, null, 625864607214491, [
  16427. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 9916823000494700, false, [
  16428. [11, "GameIsPaused"],
  16429. [8, 1],
  16430. [7, [0, 1]]
  16431. ]]
  16432. ],
  16433. [
  16434. [56, cr.behaviors.custom.prototype.acts.Accelerate, "CustomMovement2", 0xe778f03fe515e, false, [
  16435. [3, 2],
  16436. [0, [23, "GlobalSpeed"]]
  16437. ]]
  16438. ],
  16439. [
  16440. [0, null, false, null, 9455719517875960, [
  16441. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5446070398976693, false, [
  16442. [11, "CuttedAtRaw"],
  16443. [8, 1],
  16444. [7, [0, 0]]
  16445. ]]
  16446. ],
  16447. [
  16448. [-1, cr.system_object.prototype.acts.AddVar, null, 7314129080302319, false, [
  16449. [11, "ElapsedSinceLastCut"],
  16450. [7, [0, 1]]
  16451. ]]
  16452. ]
  16453. ],
  16454. [0, null, false, null, 8259834515006519, [
  16455. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x67df6160ffc2, false, [
  16456. [11, "CandyFontainIsActive"],
  16457. [8, 0],
  16458. [7, [0, 1]]
  16459. ]]
  16460. ],
  16461. [
  16462. [-1, cr.system_object.prototype.acts.AddVar, null, 881967108254761, false, [
  16463. [11, "CandyFontainIsActiveFor"],
  16464. [7, [0, 1]]
  16465. ]]
  16466. ]
  16467. ]
  16468. ]
  16469. ]
  16470. ]
  16471. ],
  16472. [0, null, false, null, 6030020678628314, [
  16473. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5716113288013841, false, [
  16474. [11, "GameIsPaused"],
  16475. [8, 1],
  16476. [7, [0, 1]]
  16477. ]],
  16478. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 7002701125321502, false, [
  16479. [11, "SlomoIsActive"],
  16480. [8, 1],
  16481. [7, [0, 1]]
  16482. ]]
  16483. ],
  16484. [],
  16485. [
  16486. [0, null, false, null, 0x6fc375ebfffe7, [
  16487. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x8f223d4a0b43e, false, [
  16488. [11, "CuttedAtRaw"],
  16489. [8, 0],
  16490. [7, [0, 0]]
  16491. ]]
  16492. ],
  16493. [
  16494. [-1, cr.system_object.prototype.acts.SetVar, null, 9123458658406860, false, [
  16495. [11, "ElapsedSinceLastCut"],
  16496. [7, [0, 0]]
  16497. ]]
  16498. ]
  16499. ],
  16500. [0, null, false, null, 8493127079863287, [
  16501. [47, cr.plugins_.Sprite.prototype.cnds.IsOverlapping, null, 0, false, false, false, 0x92153db54b519, false, [
  16502. [4, 22]
  16503. ]],
  16504. [47, cr.plugins_.Sprite.prototype.cnds.CompareWidth, null, 0, false, false, false, 8413115577728431, false, [
  16505. [8, 5],
  16506. [0, [7, [20, 22, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16507. [0, 4]
  16508. ]]
  16509. ]]
  16510. ],
  16511. [
  16512. [22, cr.plugins_.Sprite.prototype.acts.Destroy, null, 4650146375872332, false],
  16513. [22, cr.plugins_.Sprite.prototype.acts.Spawn, null, 8871154823538056, false, [
  16514. [4, 18],
  16515. [5, [0, 1]],
  16516. [7, [0, 0]]
  16517. ]],
  16518. [18, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 0xfa772c6108ba2, false, [
  16519. [3, 0],
  16520. [0, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null]]
  16521. ]],
  16522. [18, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 0x7c10d0935a628, false, [
  16523. [0, [4, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16524. [0, 90]
  16525. ]]
  16526. ]],
  16527. [18, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 4605857607331691, false, [
  16528. [0, [5, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16529. [0, 90]
  16530. ]]
  16531. ]],
  16532. [22, cr.plugins_.Sprite.prototype.acts.Spawn, null, 8785235951963116, false, [
  16533. [4, 18],
  16534. [5, [0, 1]],
  16535. [7, [0, 0]]
  16536. ]],
  16537. [18, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 6512237293391449, false, [
  16538. [3, 0],
  16539. [0, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null]]
  16540. ]],
  16541. [18, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 5853196692798881, false, [
  16542. [0, [5, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16543. [0, 90]
  16544. ]]
  16545. ]],
  16546. [18, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 5284441509140536, false, [
  16547. [0, [4, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16548. [0, 90]
  16549. ]]
  16550. ]],
  16551. [22, cr.plugins_.Sprite.prototype.acts.Spawn, null, 5993314721996034, false, [
  16552. [4, 46],
  16553. [5, [0, 0]],
  16554. [7, [0, 0]]
  16555. ]],
  16556. [46, cr.plugins_.Sprite.prototype.acts.SetSize, null, 7160971352198904, false, [
  16557. [0, [6, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16558. [0, 2]
  16559. ]],
  16560. [0, [6, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16561. [0, 2]
  16562. ]]
  16563. ]],
  16564. [-1, cr.system_object.prototype.acts.AddVar, null, 0xa74b41ded5ed9, false, [
  16565. [11, "Candies_Amount"],
  16566. [7, [0, 1]]
  16567. ]],
  16568. [22, cr.plugins_.Sprite.prototype.acts.Spawn, null, 5485534844886808, false, [
  16569. [4, 32],
  16570. [5, [0, 2]],
  16571. [7, [0, 0]]
  16572. ]],
  16573. [-1, cr.system_object.prototype.acts.AddVar, null, 0xc5672bebc59e, false, [
  16574. [11, "Score"],
  16575. [7, [0, 10]]
  16576. ]],
  16577. [-1, cr.system_object.prototype.acts.AddVar, null, 7758672500430726, false, [
  16578. [11, "CuttedAtRaw"],
  16579. [7, [0, 1]]
  16580. ]]
  16581. ],
  16582. [
  16583. [0, null, false, null, 8917449329140815, [
  16584. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xeb4a29488296a, false, [
  16585. [11, "LANG"],
  16586. [8, 0],
  16587. [7, [2, "es"]]
  16588. ]]
  16589. ],
  16590. [
  16591. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 4572167185885337, false, [
  16592. [7, [10, [2, "PUNTAJE:"],
  16593. [23, "Score"]
  16594. ]]
  16595. ]]
  16596. ]
  16597. ],
  16598. [0, null, false, null, 4961199132868215, [
  16599. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0x8066db44eb463, false]
  16600. ],
  16601. [
  16602. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0xe20e72a4fcc63, false, [
  16603. [7, [10, [2, " "],
  16604. [23, "Score"]
  16605. ]]
  16606. ]]
  16607. ]
  16608. ]
  16609. ]
  16610. ],
  16611. [0, null, false, null, 4760227365194652, [
  16612. [47, cr.plugins_.Sprite.prototype.cnds.IsOverlapping, null, 0, false, false, false, 8387187860555, false, [
  16613. [4, 21]
  16614. ]],
  16615. [47, cr.plugins_.Sprite.prototype.cnds.CompareWidth, null, 0, false, false, false, 6465583165187032, false, [
  16616. [8, 5],
  16617. [0, [7, [20, 21, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16618. [0, 4]
  16619. ]]
  16620. ]]
  16621. ],
  16622. [
  16623. [21, cr.plugins_.Sprite.prototype.acts.Destroy, null, 8740781175105327, false],
  16624. [21, cr.plugins_.Sprite.prototype.acts.Spawn, null, 0x7b5b732771155, false, [
  16625. [4, 17],
  16626. [5, [0, 1]],
  16627. [7, [0, 0]]
  16628. ]],
  16629. [17, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 7716282529865578, false, [
  16630. [3, 0],
  16631. [0, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null]]
  16632. ]],
  16633. [17, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 0x4455392c97ebc, false, [
  16634. [0, [4, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16635. [0, 90]
  16636. ]]
  16637. ]],
  16638. [17, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 6097912708635622, false, [
  16639. [0, [5, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16640. [0, 90]
  16641. ]]
  16642. ]],
  16643. [21, cr.plugins_.Sprite.prototype.acts.Spawn, null, 0xe59876b2d6c09, false, [
  16644. [4, 17],
  16645. [5, [0, 1]],
  16646. [7, [0, 0]]
  16647. ]],
  16648. [17, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 6832124705304942, false, [
  16649. [3, 0],
  16650. [0, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null]]
  16651. ]],
  16652. [17, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 9353905332356404, false, [
  16653. [0, [5, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16654. [0, 90]
  16655. ]]
  16656. ]],
  16657. [17, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 655893297677597, false, [
  16658. [0, [4, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16659. [0, 90]
  16660. ]]
  16661. ]],
  16662. [21, cr.plugins_.Sprite.prototype.acts.Spawn, null, 4861522999075538, false, [
  16663. [4, 46],
  16664. [5, [0, 0]],
  16665. [7, [0, 0]]
  16666. ]],
  16667. [46, cr.plugins_.Sprite.prototype.acts.SetSize, null, 7945951529558972, false, [
  16668. [0, [6, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16669. [0, 2]
  16670. ]],
  16671. [0, [6, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16672. [0, 2]
  16673. ]]
  16674. ]],
  16675. [-1, cr.system_object.prototype.acts.AddVar, null, 0x60c1c0c04494c, false, [
  16676. [11, "Candies_Amount"],
  16677. [7, [0, 1]]
  16678. ]],
  16679. [21, cr.plugins_.Sprite.prototype.acts.Spawn, null, 6820504629535748, false, [
  16680. [4, 33],
  16681. [5, [0, 2]],
  16682. [7, [0, 0]]
  16683. ]],
  16684. [-1, cr.system_object.prototype.acts.AddVar, null, 6391725048986914, false, [
  16685. [11, "Score"],
  16686. [7, [0, 30]]
  16687. ]],
  16688. [-1, cr.system_object.prototype.acts.AddVar, null, 8092292425733989, false, [
  16689. [11, "CuttedAtRaw"],
  16690. [7, [0, 1]]
  16691. ]]
  16692. ],
  16693. [
  16694. [0, null, false, null, 0x656e5ea9c491e, [
  16695. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 8776229217417637, false, [
  16696. [11, "LANG"],
  16697. [8, 0],
  16698. [7, [2, "es"]]
  16699. ]]
  16700. ],
  16701. [
  16702. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 5235158398981018, false, [
  16703. [7, [10, [2, "PUNTAJE:"],
  16704. [23, "Score"]
  16705. ]]
  16706. ]]
  16707. ]
  16708. ],
  16709. [0, null, false, null, 7623042934416609, [
  16710. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0x7d22b8aa96b76, false]
  16711. ],
  16712. [
  16713. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 4674972780462739, false, [
  16714. [7, [10, [2, " "],
  16715. [23, "Score"]
  16716. ]]
  16717. ]]
  16718. ]
  16719. ]
  16720. ]
  16721. ],
  16722. [0, null, false, null, 8347401128079996, [
  16723. [47, cr.plugins_.Sprite.prototype.cnds.IsOverlapping, null, 0, false, false, false, 8047327168135777, false, [
  16724. [4, 20]
  16725. ]],
  16726. [47, cr.plugins_.Sprite.prototype.cnds.CompareWidth, null, 0, false, false, false, 8683133686858099, false, [
  16727. [8, 5],
  16728. [0, [7, [20, 20, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16729. [0, 4]
  16730. ]]
  16731. ]]
  16732. ],
  16733. [
  16734. [20, cr.plugins_.Sprite.prototype.acts.Destroy, null, 8680693240130441, false],
  16735. [20, cr.plugins_.Sprite.prototype.acts.Spawn, null, 4760268332244369, false, [
  16736. [4, 19],
  16737. [5, [0, 1]],
  16738. [7, [0, 0]]
  16739. ]],
  16740. [19, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 4743491573804287, false, [
  16741. [3, 0],
  16742. [0, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null]]
  16743. ]],
  16744. [19, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 0x599569b6961d8, false, [
  16745. [0, [4, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16746. [0, 90]
  16747. ]]
  16748. ]],
  16749. [19, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 0xd53e657831756, false, [
  16750. [0, [5, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16751. [0, 90]
  16752. ]]
  16753. ]],
  16754. [20, cr.plugins_.Sprite.prototype.acts.Spawn, null, 0xbae7328698244, false, [
  16755. [4, 19],
  16756. [5, [0, 1]],
  16757. [7, [0, 0]]
  16758. ]],
  16759. [19, cr.behaviors.custom.prototype.acts.SetSpeed, "CustomMovement2", 0x96693ee8ce256, false, [
  16760. [3, 0],
  16761. [0, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null]]
  16762. ]],
  16763. [19, cr.behaviors.custom.prototype.acts.SetAngleOfMotion, "CustomMovement2", 748726927692113, false, [
  16764. [0, [5, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16765. [0, 90]
  16766. ]]
  16767. ]],
  16768. [19, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 5717916157626853, false, [
  16769. [0, [4, [20, 47, cr.plugins_.Sprite.prototype.exps.Angle, false, null],
  16770. [0, 90]
  16771. ]]
  16772. ]],
  16773. [20, cr.plugins_.Sprite.prototype.acts.Spawn, null, 0x9eb809d1b0372, false, [
  16774. [4, 46],
  16775. [5, [0, 0]],
  16776. [7, [0, 0]]
  16777. ]],
  16778. [46, cr.plugins_.Sprite.prototype.acts.SetSize, null, 0xbdbef0781a99f, false, [
  16779. [0, [6, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16780. [0, 2]
  16781. ]],
  16782. [0, [6, [20, 47, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  16783. [0, 2]
  16784. ]]
  16785. ]],
  16786. [-1, cr.system_object.prototype.acts.AddVar, null, 7213889005725447, false, [
  16787. [11, "Candies_Amount"],
  16788. [7, [0, 1]]
  16789. ]],
  16790. [20, cr.plugins_.Sprite.prototype.acts.Spawn, null, 0xd9eabb92ea42a, false, [
  16791. [4, 36],
  16792. [5, [0, 2]],
  16793. [7, [0, 0]]
  16794. ]],
  16795. [-1, cr.system_object.prototype.acts.AddVar, null, 8082879853677376, false, [
  16796. [11, "Score"],
  16797. [7, [0, 50]]
  16798. ]],
  16799. [-1, cr.system_object.prototype.acts.AddVar, null, 9071133409929528, false, [
  16800. [11, "CuttedAtRaw"],
  16801. [7, [0, 1]]
  16802. ]]
  16803. ],
  16804. [
  16805. [0, null, false, null, 0x82e9f8b924f34, [
  16806. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 7443089340077125, false, [
  16807. [11, "LANG"],
  16808. [8, 0],
  16809. [7, [2, "es"]]
  16810. ]]
  16811. ],
  16812. [
  16813. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 8046492840883409, false, [
  16814. [7, [10, [2, "PUNTAJE:"],
  16815. [23, "Score"]
  16816. ]]
  16817. ]]
  16818. ]
  16819. ],
  16820. [0, null, false, null, 0xdc7dcd0364aaf, [
  16821. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 653394628917152, false]
  16822. ],
  16823. [
  16824. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0xfcec6a86954cd, false, [
  16825. [7, [10, [2, " "],
  16826. [23, "Score"]
  16827. ]]
  16828. ]]
  16829. ]
  16830. ]
  16831. ]
  16832. ]
  16833. ]
  16834. ],
  16835. [0, null, true, null, 6080818693841965, [
  16836. [29, cr.plugins_.Mouse.prototype.cnds.OnRelease, null, 1, false, false, false, 8559412079228267, false, [
  16837. [3, 0]
  16838. ]],
  16839. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x69fecdcec424f, false, [
  16840. [11, "ElapsedSinceLastCut"],
  16841. [8, 4],
  16842. [7, [0, 20]]
  16843. ]],
  16844. [30, cr.plugins_.Touch.prototype.cnds.OnTouchEnd, null, 1, false, false, false, 0xb1512f14ad3e7, false]
  16845. ],
  16846. [],
  16847. [
  16848. [0, null, false, null, 8541465445627343, [
  16849. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 6214401596773964, false, [
  16850. [11, "CuttedAtRaw"],
  16851. [8, 4],
  16852. [7, [0, 2]]
  16853. ]]
  16854. ],
  16855. [
  16856. [62, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x682f8da6353e5, false]
  16857. ],
  16858. [
  16859. [0, null, false, null, 5823350887302462, [
  16860. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xa306bfdf6a10f, false, [
  16861. [11, "CuttedAtRaw"],
  16862. [8, 0],
  16863. [7, [0, 3]]
  16864. ]]
  16865. ],
  16866. [
  16867. [-1, cr.system_object.prototype.acts.CreateObject, null, 8185334619146284, false, [
  16868. [4, 34],
  16869. [5, [0, 2]],
  16870. [0, [7, [19, cr.system_object.prototype.exps.layoutwidth],
  16871. [0, 2]
  16872. ]],
  16873. [0, [7, [19, cr.system_object.prototype.exps.layoutheight],
  16874. [0, 2]
  16875. ]]
  16876. ]],
  16877. [-1, cr.system_object.prototype.acts.AddVar, null, 0xe1b63cc417118, false, [
  16878. [11, "Score"],
  16879. [7, [0, 30]]
  16880. ]],
  16881. [-1, cr.system_object.prototype.acts.SetVar, null, 7938495860764223, false, [
  16882. [11, "ElapsedSinceLastCut"],
  16883. [7, [0, 0]]
  16884. ]],
  16885. [-1, cr.system_object.prototype.acts.SetVar, null, 6413250676086552, false, [
  16886. [11, "MouseBeenReleaseSinceLastCut"],
  16887. [7, [0, 0]]
  16888. ]],
  16889. [-1, cr.system_object.prototype.acts.SetVar, null, 651350986694386, false, [
  16890. [11, "CuttedAtRaw"],
  16891. [7, [0, 0]]
  16892. ]]
  16893. ],
  16894. [
  16895. [0, null, false, null, 5783763481490649, [
  16896. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xd9bdfb9872679, false, [
  16897. [11, "LANG"],
  16898. [8, 0],
  16899. [7, [2, "en"]]
  16900. ]]
  16901. ],
  16902. [
  16903. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 8824638699154988, false, [
  16904. [7, [10, [2, " "],
  16905. [23, "Score"]
  16906. ]]
  16907. ]]
  16908. ]
  16909. ],
  16910. [0, null, false, null, 7601738940358797, [
  16911. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 982470320388523, false]
  16912. ],
  16913. [
  16914. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 8647667191187012, false, [
  16915. [7, [10, [2, "PUNTAJE:"],
  16916. [23, "Score"]
  16917. ]]
  16918. ]]
  16919. ]
  16920. ]
  16921. ]
  16922. ],
  16923. [0, null, false, null, 6592376484444267, [
  16924. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 6732178774229566, false, [
  16925. [11, "CuttedAtRaw"],
  16926. [8, 0],
  16927. [7, [0, 4]]
  16928. ]]
  16929. ],
  16930. [
  16931. [-1, cr.system_object.prototype.acts.CreateObject, null, 7439393669589158, false, [
  16932. [4, 35],
  16933. [5, [0, 2]],
  16934. [0, [7, [19, cr.system_object.prototype.exps.layoutwidth],
  16935. [0, 2]
  16936. ]],
  16937. [0, [7, [19, cr.system_object.prototype.exps.layoutheight],
  16938. [0, 2]
  16939. ]]
  16940. ]],
  16941. [-1, cr.system_object.prototype.acts.AddVar, null, 6693895834208048, false, [
  16942. [11, "Score"],
  16943. [7, [0, 40]]
  16944. ]],
  16945. [-1, cr.system_object.prototype.acts.SetVar, null, 0xd2cac4c9ea498, false, [
  16946. [11, "ElapsedSinceLastCut"],
  16947. [7, [0, 0]]
  16948. ]],
  16949. [-1, cr.system_object.prototype.acts.SetVar, null, 9678049925105540, false, [
  16950. [11, "MouseBeenReleaseSinceLastCut"],
  16951. [7, [0, 0]]
  16952. ]],
  16953. [-1, cr.system_object.prototype.acts.SetVar, null, 9592563698270784, false, [
  16954. [11, "CuttedAtRaw"],
  16955. [7, [0, 0]]
  16956. ]]
  16957. ],
  16958. [
  16959. [0, null, false, null, 7322803436282442, [
  16960. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xb5ed4f3da71ce, false, [
  16961. [11, "LANG"],
  16962. [8, 0],
  16963. [7, [2, "es"]]
  16964. ]]
  16965. ],
  16966. [
  16967. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 9857038563030242, false, [
  16968. [7, [10, [2, "PUNTAJE:"],
  16969. [23, "Score"]
  16970. ]]
  16971. ]]
  16972. ]
  16973. ],
  16974. [0, null, false, null, 8423693208518711, [
  16975. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0xc24726e804d5f, false]
  16976. ],
  16977. [
  16978. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0x662d43b359b04, false, [
  16979. [7, [10, [2, " "],
  16980. [23, "Score"]
  16981. ]]
  16982. ]]
  16983. ]
  16984. ]
  16985. ]
  16986. ],
  16987. [0, null, false, null, 0xc00ba24708f20, [
  16988. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 8672819983754613, false, [
  16989. [11, "CuttedAtRaw"],
  16990. [8, 0],
  16991. [7, [0, 5]]
  16992. ]]
  16993. ],
  16994. [
  16995. [-1, cr.system_object.prototype.acts.CreateObject, null, 4509619447018252, false, [
  16996. [4, 37],
  16997. [5, [0, 2]],
  16998. [0, [7, [19, cr.system_object.prototype.exps.layoutwidth],
  16999. [0, 2]
  17000. ]],
  17001. [0, [7, [19, cr.system_object.prototype.exps.layoutheight],
  17002. [0, 2]
  17003. ]]
  17004. ]],
  17005. [-1, cr.system_object.prototype.acts.AddVar, null, 4507112079150583, false, [
  17006. [11, "Score"],
  17007. [7, [0, 50]]
  17008. ]],
  17009. [-1, cr.system_object.prototype.acts.SetVar, null, 8862729295659629, false, [
  17010. [11, "ElapsedSinceLastCut"],
  17011. [7, [0, 0]]
  17012. ]],
  17013. [-1, cr.system_object.prototype.acts.SetVar, null, 6853232246662692, false, [
  17014. [11, "MouseBeenReleaseSinceLastCut"],
  17015. [7, [0, 0]]
  17016. ]],
  17017. [-1, cr.system_object.prototype.acts.SetVar, null, 7929038798878766, false, [
  17018. [11, "CuttedAtRaw"],
  17019. [7, [0, 0]]
  17020. ]]
  17021. ],
  17022. [
  17023. [0, null, false, null, 0xad67364b186c4, [
  17024. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 7527985602434372, false, [
  17025. [11, "LANG"],
  17026. [8, 0],
  17027. [7, [2, "en"]]
  17028. ]]
  17029. ],
  17030. [
  17031. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 7948289187562602, false, [
  17032. [7, [10, [2, " "],
  17033. [23, "Score"]
  17034. ]]
  17035. ]]
  17036. ]
  17037. ],
  17038. [0, null, false, null, 0x4be1d28d8e97a, [
  17039. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 6470691792682331, false]
  17040. ],
  17041. [
  17042. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 4852314307202568, false, [
  17043. [7, [10, [2, "PUNTAJE:"],
  17044. [23, "Score"]
  17045. ]]
  17046. ]]
  17047. ]
  17048. ]
  17049. ]
  17050. ],
  17051. [0, null, false, null, 8346247803789636, [
  17052. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 9610429944826140, false, [
  17053. [11, "CuttedAtRaw"],
  17054. [8, 4],
  17055. [7, [0, 5]]
  17056. ]]
  17057. ],
  17058. [
  17059. [-1, cr.system_object.prototype.acts.CreateObject, null, 429899012368231, false, [
  17060. [4, 39],
  17061. [5, [0, 2]],
  17062. [0, [7, [19, cr.system_object.prototype.exps.layoutwidth],
  17063. [0, 2]
  17064. ]],
  17065. [0, [7, [19, cr.system_object.prototype.exps.layoutheight],
  17066. [0, 2]
  17067. ]]
  17068. ]],
  17069. [-1, cr.system_object.prototype.acts.AddVar, null, 0xd2df8bd901517, false, [
  17070. [11, "Score"],
  17071. [7, [0, 100]]
  17072. ]],
  17073. [-1, cr.system_object.prototype.acts.SetVar, null, 6585280724333992, false, [
  17074. [11, "ElapsedSinceLastCut"],
  17075. [7, [0, 0]]
  17076. ]],
  17077. [-1, cr.system_object.prototype.acts.SetVar, null, 9403566578144688, false, [
  17078. [11, "MouseBeenReleaseSinceLastCut"],
  17079. [7, [0, 0]]
  17080. ]],
  17081. [-1, cr.system_object.prototype.acts.SetVar, null, 7774165251762663, false, [
  17082. [11, "CuttedAtRaw"],
  17083. [7, [0, 0]]
  17084. ]]
  17085. ],
  17086. [
  17087. [0, null, false, null, 0xc27c57a329642, [
  17088. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x646145cabe652, false, [
  17089. [11, "LANG"],
  17090. [8, 0],
  17091. [7, [2, "es"]]
  17092. ]]
  17093. ],
  17094. [
  17095. [39, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 4937860509171779, false, [
  17096. [0, [0, 1]]
  17097. ]],
  17098. [39, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 7979733321069636, false],
  17099. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 732317037949513, false, [
  17100. [7, [10, [2, "PUNTAJE:"],
  17101. [23, "Score"]
  17102. ]]
  17103. ]]
  17104. ]
  17105. ],
  17106. [0, null, false, null, 4884380804361563, [
  17107. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0xba1897acddcec, false]
  17108. ],
  17109. [
  17110. [39, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 324537398061168, false, [
  17111. [0, [0, 0]]
  17112. ]],
  17113. [39, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 9575381994614832, false],
  17114. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 6157889859035316, false, [
  17115. [7, [10, [2, " "],
  17116. [23, "Score"]
  17117. ]]
  17118. ]]
  17119. ]
  17120. ]
  17121. ]
  17122. ]
  17123. ]
  17124. ],
  17125. [0, null, false, null, 0xc1f6847ffa2dd, [
  17126. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0xb90065674559f, false]
  17127. ],
  17128. [
  17129. [-1, cr.system_object.prototype.acts.SetVar, null, 8422628010004437, false, [
  17130. [11, "ElapsedSinceLastCut"],
  17131. [7, [0, 0]]
  17132. ]],
  17133. [-1, cr.system_object.prototype.acts.SetVar, null, 0xf435aaf56f5e1, false, [
  17134. [11, "MouseBeenReleaseSinceLastCut"],
  17135. [7, [0, 0]]
  17136. ]],
  17137. [-1, cr.system_object.prototype.acts.SetVar, null, 0xcce45ae8208ab, false, [
  17138. [11, "CuttedAtRaw"],
  17139. [7, [0, 0]]
  17140. ]]
  17141. ]
  17142. ]
  17143. ]
  17144. ],
  17145. [0, null, false, null, 5996463625238656, [
  17146. [47, cr.plugins_.Sprite.prototype.cnds.IsOverlapping, null, 0, false, false, false, 5076735141738713, false, [
  17147. [4, 57]
  17148. ]],
  17149. [47, cr.plugins_.Sprite.prototype.cnds.CompareWidth, null, 0, false, false, false, 8587842304227216, false, [
  17150. [8, 5],
  17151. [0, [7, [20, 57, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  17152. [0, 2]
  17153. ]]
  17154. ]],
  17155. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x4ddbc681ed606, false, [
  17156. [11, "GameIsPaused"],
  17157. [8, 1],
  17158. [7, [0, 1]]
  17159. ]],
  17160. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xef36194daf63d, false, [
  17161. [11, "SlomoIsActive"],
  17162. [8, 1],
  17163. [7, [0, 1]]
  17164. ]]
  17165. ],
  17166. [
  17167. [57, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x60c8d47c05b69, false],
  17168. [57, cr.plugins_.Sprite.prototype.acts.Spawn, null, 6118527316936416, false, [
  17169. [4, 16],
  17170. [5, [0, 1]],
  17171. [7, [0, 0]]
  17172. ]],
  17173. [16, cr.plugins_.Sprite.prototype.acts.SetAnimSpeed, null, 0x5f9225d34f73e, false, [
  17174. [0, [0, 25]]
  17175. ]],
  17176. [16, cr.plugins_.Sprite.prototype.acts.SetAngle, null, 7876454773903579, false, [
  17177. [0, [19, cr.system_object.prototype.exps.random, [
  17178. [0, 360]
  17179. ]]]
  17180. ]],
  17181. [-1, cr.system_object.prototype.acts.SubVar, null, 8287667579560846, false, [
  17182. [11, "Lives"],
  17183. [7, [0, 1]]
  17184. ]]
  17185. ],
  17186. [
  17187. [0, null, false, null, 6468099111072039, [
  17188. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xe55c48c0f1bc2, false, [
  17189. [11, "Lives"],
  17190. [8, 5],
  17191. [7, [0, 0]]
  17192. ]]
  17193. ],
  17194. [
  17195. [28, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 7215508842746293, false, [
  17196. [0, [23, "Lives"]]
  17197. ]]
  17198. ]
  17199. ]
  17200. ]
  17201. ],
  17202. [0, null, false, null, 7201721173609944, [
  17203. [47, cr.plugins_.Sprite.prototype.cnds.IsOverlapping, null, 0, false, false, false, 0xf6d48615a1558, false, [
  17204. [4, 23]
  17205. ]],
  17206. [47, cr.plugins_.Sprite.prototype.cnds.CompareWidth, null, 0, false, false, false, 0x9ead38af89c50, false, [
  17207. [8, 5],
  17208. [0, [7, [20, 23, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  17209. [0, 8]
  17210. ]]
  17211. ]],
  17212. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 6920352977967678, false, [
  17213. [11, "GameIsPaused"],
  17214. [8, 1],
  17215. [7, [0, 1]]
  17216. ]],
  17217. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xe78f6b43a6cb1, false, [
  17218. [11, "SlomoIsActive"],
  17219. [8, 1],
  17220. [7, [0, 1]]
  17221. ]]
  17222. ],
  17223. [
  17224. [23, cr.plugins_.Sprite.prototype.acts.Destroy, null, 6752963549167137, false],
  17225. [23, cr.plugins_.Sprite.prototype.acts.Spawn, null, 5822288710094212, false, [
  17226. [4, 24],
  17227. [5, [0, 1]],
  17228. [7, [0, 0]]
  17229. ]],
  17230. [24, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "LiteTween", 0x44c5dfb3ee368, false, [
  17231. [3, 0]
  17232. ]],
  17233. [24, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "LiteTween2", 7686337962420552, false, [
  17234. [3, 0]
  17235. ]],
  17236. [24, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "LiteTween3", 4752632369457006, false, [
  17237. [3, 0]
  17238. ]],
  17239. [-1, cr.system_object.prototype.acts.Wait, null, 0x8d24629049b8d, false, [
  17240. [0, [0, 2]]
  17241. ]],
  17242. [24, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x444557911b7d0, false]
  17243. ],
  17244. [
  17245. [0, null, false, null, 8625413571961103, [
  17246. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x3a33b8c04ee74, false, [
  17247. [11, "Lives"],
  17248. [8, 2],
  17249. [7, [0, 2]]
  17250. ]]
  17251. ],
  17252. [
  17253. [-1, cr.system_object.prototype.acts.AddVar, null, 0x3f1bb01f2e2a5, false, [
  17254. [11, "Lives"],
  17255. [7, [0, 1]]
  17256. ]],
  17257. [28, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 593744193509825, false, [
  17258. [0, [23, "Lives"]]
  17259. ]]
  17260. ]
  17261. ]
  17262. ]
  17263. ],
  17264. [0, null, false, null, 0xc6cb788876ff7, [
  17265. [47, cr.plugins_.Sprite.prototype.cnds.IsOverlapping, null, 0, false, false, false, 0x7df24d4ea8326, false, [
  17266. [4, 25]
  17267. ]],
  17268. [47, cr.plugins_.Sprite.prototype.cnds.CompareWidth, null, 0, false, false, false, 0x8522d57f4fa1d, false, [
  17269. [8, 5],
  17270. [0, [7, [20, 25, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  17271. [0, 8]
  17272. ]]
  17273. ]],
  17274. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x7ddaf0a0fcc5d, false, [
  17275. [11, "GameIsPaused"],
  17276. [8, 1],
  17277. [7, [0, 1]]
  17278. ]],
  17279. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 9945201697037760, false, [
  17280. [11, "SlomoIsActive"],
  17281. [8, 1],
  17282. [7, [0, 1]]
  17283. ]]
  17284. ],
  17285. [
  17286. [25, cr.plugins_.Sprite.prototype.acts.Destroy, null, 6513491906588931, false],
  17287. [25, cr.plugins_.Sprite.prototype.acts.Spawn, null, 0x5c23e9072719d, false, [
  17288. [4, 26],
  17289. [5, [0, 1]],
  17290. [7, [0, 0]]
  17291. ]]
  17292. ],
  17293. [
  17294. [0, null, false, null, 0xa03e3287503a1, [
  17295. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 4873055029171698, false, [
  17296. [11, "CandyFontainIsActive"],
  17297. [8, 0],
  17298. [7, [0, 0]]
  17299. ]]
  17300. ],
  17301. [
  17302. [-1, cr.system_object.prototype.acts.SetVar, null, 6591445576310618, false, [
  17303. [11, "CandyFontainIsActive"],
  17304. [7, [0, 1]]
  17305. ]],
  17306. [-1, cr.system_object.prototype.acts.SetVar, null, 5772371554525446, false, [
  17307. [11, "SpawnCandiesTime"],
  17308. [7, [1, .1]]
  17309. ]],
  17310. [-1, cr.system_object.prototype.acts.SetVar, null, 523126012320112, false, [
  17311. [11, "SpawnCandiesTimeRandOffset"],
  17312. [7, [1, .1]]
  17313. ]],
  17314. [62, cr.plugins_.Sprite.prototype.acts.Destroy, null, 8271809591340191, false],
  17315. [-1, cr.system_object.prototype.acts.CreateObject, null, 0xe7bb7906ea6f4, false, [
  17316. [4, 38],
  17317. [5, [0, 2]],
  17318. [0, [7, [19, cr.system_object.prototype.exps.layoutwidth],
  17319. [0, 2]
  17320. ]],
  17321. [0, [7, [19, cr.system_object.prototype.exps.layoutheight],
  17322. [0, 2]
  17323. ]]
  17324. ]]
  17325. ]
  17326. ]
  17327. ]
  17328. ],
  17329. [0, null, true, null, 6405825839671163, [
  17330. [29, cr.plugins_.Mouse.prototype.cnds.OnRelease, null, 1, false, false, false, 5976957914350759, false, [
  17331. [3, 0]
  17332. ]],
  17333. [30, cr.plugins_.Touch.prototype.cnds.OnTouchEnd, null, 1, false, false, false, 0xee3fe5c86fdc2, false]
  17334. ],
  17335. [
  17336. [-1, cr.system_object.prototype.acts.SetVar, null, 7532124217750597, false, [
  17337. [11, "MouseBeenReleaseSinceLastCut"],
  17338. [7, [0, 1]]
  17339. ]]
  17340. ]
  17341. ],
  17342. [0, null, false, null, 6496833290878127, [
  17343. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 8281996591910145, false, [
  17344. [11, "GameIsPaused"],
  17345. [8, 0],
  17346. [7, [0, 1]]
  17347. ]]
  17348. ],
  17349. [],
  17350. [
  17351. [0, null, true, null, 7927639622173751, [
  17352. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 40279358929321, false, [
  17353. [3, 0],
  17354. [3, 0],
  17355. [4, 5]
  17356. ]],
  17357. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 0x8035e11a82d75, false, [
  17358. [4, 5]
  17359. ]]
  17360. ],
  17361. [],
  17362. [
  17363. [0, null, false, null, 6384338523563332, [
  17364. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 9281946248044072, false, [
  17365. [11, "BestScore"],
  17366. [8, 2],
  17367. [7, [23, "Score"]]
  17368. ]]
  17369. ],
  17370. [
  17371. [-1, cr.system_object.prototype.acts.SetVar, null, 0x8682413edc4f, false, [
  17372. [11, "BestScore"],
  17373. [7, [23, "Score"]]
  17374. ]]
  17375. ]
  17376. ]
  17377. ]
  17378. ],
  17379. [0, null, true, null, 9523724846481996, [
  17380. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 6292997461636642, false, [
  17381. [3, 0],
  17382. [3, 0],
  17383. [4, 5]
  17384. ]],
  17385. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 0xef05f1ae2e4fe, false, [
  17386. [4, 5]
  17387. ]]
  17388. ],
  17389. [
  17390. [-1, cr.system_object.prototype.acts.SetVar, null, 0xbf103ad2df4cb, false, [
  17391. [11, "GameIsPaused"],
  17392. [7, [0, 0]]
  17393. ]],
  17394. [-1, cr.system_object.prototype.acts.SetVar, null, 6787210906365316, false, [
  17395. [11, "MouseBeenReleaseSinceLastCut"],
  17396. [7, [0, 0]]
  17397. ]],
  17398. [-1, cr.system_object.prototype.acts.SetVar, null, 8910326485546273, false, [
  17399. [11, "Candies_Amount"],
  17400. [7, [0, 0]]
  17401. ]],
  17402. [-1, cr.system_object.prototype.acts.SetVar, null, 0x7649de7d14f4d, false, [
  17403. [11, "Score"],
  17404. [7, [0, 0]]
  17405. ]],
  17406. [-1, cr.system_object.prototype.acts.SetVar, null, 0xf7b060f78bc10, false, [
  17407. [11, "CandyFontainIsActive"],
  17408. [7, [0, 0]]
  17409. ]],
  17410. [-1, cr.system_object.prototype.acts.SetVar, null, 7548294045840928, false, [
  17411. [11, "CandyFontainIsActiveFor"],
  17412. [7, [0, 0]]
  17413. ]],
  17414. [-1, cr.system_object.prototype.acts.SetTimescale, null, 0xc0072b51b1925, false, [
  17415. [0, [1, 1]]
  17416. ]],
  17417. [-1, cr.system_object.prototype.acts.SetVar, null, 0x939d704501820, false, [
  17418. [11, "SlomoIsActive"],
  17419. [7, [0, 0]]
  17420. ]],
  17421. [-1, cr.system_object.prototype.acts.SetVar, null, 0xbc70244981c30, false, [
  17422. [11, "BombsSpawnDelayDone"],
  17423. [7, [0, 0]]
  17424. ]],
  17425. [-1, cr.system_object.prototype.acts.SetVar, null, 589896454099903, false, [
  17426. [11, "Lives"],
  17427. [7, [0, 2]]
  17428. ]],
  17429. [27, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 7617541839998137, false, [
  17430. [3, 1]
  17431. ]],
  17432. [2, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 0x4519bea6bdd22, false, [
  17433. [3, 1]
  17434. ]],
  17435. [28, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 7339303735138867, false, [
  17436. [3, 1]
  17437. ]],
  17438. [28, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 0xc0961985810cb, false, [
  17439. [0, [23, "Lives"]]
  17440. ]],
  17441. [3, cr.plugins_.Sprite.prototype.acts.Destroy, null, 8338095477456938, false],
  17442. [5, cr.plugins_.Sprite.prototype.acts.Destroy, null, 9201003743690204, false],
  17443. [4, cr.plugins_.Sprite.prototype.acts.Destroy, null, 8547764379099402, false],
  17444. [47, cr.plugins_.Sprite.prototype.acts.Destroy, null, 8088803127723427, false],
  17445. [46, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x8c6e46fc97c3, false],
  17446. [56, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x8fdf0d63a2325, false],
  17447. [61, cr.plugins_.Sprite.prototype.acts.Destroy, null, 878084447261485, false],
  17448. [24, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0xc4c53d87c05d1, false],
  17449. [26, cr.plugins_.Particles.prototype.acts.Destroy, null, 624576331633458, false],
  17450. [10, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0xf263599d38360, false],
  17451. [12, cr.plugins_.Sprite.prototype.acts.Destroy, null, 6288097401018803, false],
  17452. [53, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 0x60fbb2167829f, false, [
  17453. [3, 1]
  17454. ]],
  17455. [52, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 6667596144226839, false, [
  17456. [3, 1]
  17457. ]],
  17458. [50, cr.plugins_.Spritefont2.prototype.acts.Destroy, null, 0xbc23124ad163a, false],
  17459. [51, cr.plugins_.Spritefont2.prototype.acts.Destroy, null, 0xbd993175b213e, false],
  17460. [-1, cr.system_object.prototype.acts.CreateObject, null, 5701083006875338, false, [
  17461. [4, 13],
  17462. [5, [0, 4]],
  17463. [0, [0, 0]],
  17464. [0, [0, 0]]
  17465. ]],
  17466. [13, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 0xee980366afa42, false, [
  17467. [0, [0, 0]]
  17468. ]],
  17469. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "start", 0xb95bf93d25f2d, false, [
  17470. [3, 0]
  17471. ]],
  17472. [-1, cr.system_object.prototype.acts.Wait, null, 8000820260313573, false, [
  17473. [0, [1, .3]]
  17474. ]]
  17475. ],
  17476. [
  17477. [0, null, false, null, 0xfa1cedce8d596, [
  17478. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5859308351895978, false, [
  17479. [11, "LANG"],
  17480. [8, 0],
  17481. [7, [2, "es"]]
  17482. ]]
  17483. ],
  17484. [
  17485. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 8214875765164281, false, [
  17486. [7, [10, [2, "PUNTAJE:"],
  17487. [23, "Score"]
  17488. ]]
  17489. ]],
  17490. [52, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0xd78a0053c5b15, false, [
  17491. [7, [10, [2, "MEJOR:"],
  17492. [23, "BestScore"]
  17493. ]]
  17494. ]]
  17495. ]
  17496. ],
  17497. [0, null, false, null, 0x9dda64ac71772, [
  17498. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0x86e7146735ad7, false]
  17499. ],
  17500. [
  17501. [53, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0xbae54832ad041, false, [
  17502. [7, [10, [2, " "],
  17503. [23, "Score"]
  17504. ]]
  17505. ]],
  17506. [52, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0x42db38a887190, false, [
  17507. [7, [10, [2, "BEST:"],
  17508. [23, "BestScore"]
  17509. ]]
  17510. ]]
  17511. ]
  17512. ],
  17513. [0, null, false, null, 0xb6112c93880df, [],
  17514. [
  17515. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "stop", 0xd58a4470ccd6, false, [
  17516. [3, 0]
  17517. ]],
  17518. [-1, cr.system_object.prototype.acts.Wait, null, 6390269172949222, false, [
  17519. [0, [1, .3]]
  17520. ]],
  17521. [13, cr.plugins_.Sprite.prototype.acts.Destroy, null, 8924053971660529, false]
  17522. ]
  17523. ]
  17524. ]
  17525. ]
  17526. ]
  17527. ],
  17528. [0, null, false, null, 0x9b980fac4198, [
  17529. [56, cr.plugins_.Sprite.prototype.cnds.CompareY, null, 0, false, false, false, 0x46ddeb6f2b297, false, [
  17530. [8, 4],
  17531. [0, [4, [19, cr.system_object.prototype.exps.layoutheight],
  17532. [6, [20, 56, cr.plugins_.Sprite.prototype.exps.Width, false, null],
  17533. [0, 3]
  17534. ]
  17535. ]]
  17536. ]]
  17537. ],
  17538. [
  17539. [56, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x8b6ee4432fba0, false]
  17540. ]
  17541. ],
  17542. [0, null, false, null, 5003848556370103, [
  17543. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 541729022589367, false, [
  17544. [11, "Lives"],
  17545. [8, 2],
  17546. [7, [0, 0]]
  17547. ]],
  17548. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x84366732b8a5e, false, [
  17549. [11, "GameIsPaused"],
  17550. [8, 0],
  17551. [7, [0, 0]]
  17552. ]],
  17553. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5052450517383688, false, [
  17554. [11, "SlomoIsActive"],
  17555. [8, 0],
  17556. [7, [0, 0]]
  17557. ]]
  17558. ],
  17559. [
  17560. [55, cr.plugins_.Browser.prototype.acts.ExecJs, null, 8773714266864497, false, [
  17561. [1, [2, "window.c2_level = 0"]]
  17562. ]],
  17563. [55, cr.plugins_.Browser.prototype.acts.ExecJs, null, 522830245742878, false, [
  17564. [1, [10, [10, [2, "window.c2_score="],
  17565. [23, "Score"]
  17566. ],
  17567. [2, ""]
  17568. ]]
  17569. ]],
  17570. [48, cr.plugins_.Softgames.prototype.acts.gameOver, null, 5110249338674038, false],
  17571. [28, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 6011242799732131, false, [
  17572. [3, 0]
  17573. ]],
  17574. [-1, cr.system_object.prototype.acts.SetVar, null, 770605679585685, false, [
  17575. [11, "SlomoIsActive"],
  17576. [7, [0, 1]]
  17577. ]],
  17578. [-1, cr.system_object.prototype.acts.SetTimescale, null, 8824445748543782, false, [
  17579. [0, [1, .5]]
  17580. ]],
  17581. [-1, cr.system_object.prototype.acts.Wait, null, 0xdfa44b544ded8, false, [
  17582. [0, [0, 1]]
  17583. ]],
  17584. [-1, cr.system_object.prototype.acts.SetTimescale, null, 77428706961359, false, [
  17585. [0, [0, 1]]
  17586. ]],
  17587. [-1, cr.system_object.prototype.acts.Wait, null, 9698944552338880, false, [
  17588. [0, [0, 1]]
  17589. ]],
  17590. [-1, cr.system_object.prototype.acts.SetVar, null, 0xa9aaa52ece9ad, false, [
  17591. [11, "GameIsPaused"],
  17592. [7, [0, 1]]
  17593. ]],
  17594. [-1, cr.system_object.prototype.acts.SetVar, null, 4923768814490621, false, [
  17595. [11, "SlomoIsActive"],
  17596. [7, [0, 0]]
  17597. ]],
  17598. [-1, cr.system_object.prototype.acts.CreateObject, null, 0x4414cbeae3fb0, false, [
  17599. [4, 13],
  17600. [5, [0, 4]],
  17601. [0, [0, 0]],
  17602. [0, [0, 0]]
  17603. ]],
  17604. [13, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 8081687774340519, false, [
  17605. [0, [0, 0]]
  17606. ]],
  17607. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "start", 5987008171274848, false, [
  17608. [3, 0]
  17609. ]],
  17610. [-1, cr.system_object.prototype.acts.Wait, null, 760560107751624, false, [
  17611. [0, [1, .3]]
  17612. ]],
  17613. [61, cr.plugins_.Sprite.prototype.acts.Destroy, null, 9574951935332582, false],
  17614. [56, cr.plugins_.Sprite.prototype.acts.Destroy, null, 5807413108808871, false],
  17615. [24, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0xd5908c7088e70, false],
  17616. [26, cr.plugins_.Particles.prototype.acts.Destroy, null, 7739926647257792, false],
  17617. [27, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 0x760dc95ef98a1, false, [
  17618. [3, 0]
  17619. ]],
  17620. [2, cr.plugins_.Sprite.prototype.acts.SetVisible, null, 9625648051935414, false, [
  17621. [3, 0]
  17622. ]],
  17623. [53, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 6990764514731954, false, [
  17624. [3, 0]
  17625. ]],
  17626. [52, cr.plugins_.Spritefont2.prototype.acts.SetVisible, null, 516512452758876, false, [
  17627. [3, 0]
  17628. ]],
  17629. [-1, cr.system_object.prototype.acts.CreateObject, null, 0xb3fe4fc039ad7, false, [
  17630. [4, 12],
  17631. [5, [0, 3]],
  17632. [0, [0, 0]],
  17633. [0, [0, 0]]
  17634. ]],
  17635. [-1, cr.system_object.prototype.acts.CreateObject, null, 0xefc8035ddbe05, false, [
  17636. [4, 5],
  17637. [5, [0, 3]],
  17638. [0, [0, 252]],
  17639. [0, [0, 336]]
  17640. ]],
  17641. [-1, cr.system_object.prototype.acts.CreateObject, null, 4892400712814428, false, [
  17642. [4, 3],
  17643. [5, [0, 3]],
  17644. [0, [0, 64]],
  17645. [0, [0, 330]]
  17646. ]],
  17647. [-1, cr.system_object.prototype.acts.CreateObject, null, 488147896038764, false, [
  17648. [4, 50],
  17649. [5, [0, 3]],
  17650. [0, [0, 55]],
  17651. [0, [0, 180]]
  17652. ]],
  17653. [-1, cr.system_object.prototype.acts.CreateObject, null, 0x39c6c3e6e71a6, false, [
  17654. [4, 51],
  17655. [5, [0, 3]],
  17656. [0, [0, 55]],
  17657. [0, [0, 210]]
  17658. ]]
  17659. ],
  17660. [
  17661. [0, null, false, null, 0xf8de527d7d1ef, [
  17662. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 9927545946162448, false, [
  17663. [11, "LANG"],
  17664. [8, 0],
  17665. [7, [2, "es"]]
  17666. ]]
  17667. ],
  17668. [
  17669. [12, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 0xa592cd4f0962d, false, [
  17670. [0, [0, 1]]
  17671. ]],
  17672. [12, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 0xf99450206a83, false],
  17673. [51, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 5428449903552759, false, [
  17674. [7, [10, [2, "PUNTAJE:"],
  17675. [23, "Score"]
  17676. ]]
  17677. ]],
  17678. [50, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 4553457772996537, false, [
  17679. [7, [10, [2, "FRUTAS:"],
  17680. [23, "Candies_Amount"]
  17681. ]]
  17682. ]]
  17683. ]
  17684. ],
  17685. [0, null, false, null, 0xcfbc4a802ca82, [
  17686. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 7604775900745352, false]
  17687. ],
  17688. [
  17689. [12, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 9999898491917928, false, [
  17690. [0, [0, 0]]
  17691. ]],
  17692. [12, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 5587110823978502, false],
  17693. [51, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0x77ec3f5982e53, false, [
  17694. [7, [10, [2, " "],
  17695. [23, "Score"]
  17696. ]]
  17697. ]],
  17698. [50, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0xd3f4cb04019a, false, [
  17699. [7, [10, [2, " "],
  17700. [23, "Candies_Amount"]
  17701. ]]
  17702. ]]
  17703. ]
  17704. ],
  17705. [0, null, false, null, 8629838128974253, [],
  17706. [
  17707. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "stop", 0xba8c4f9e97977, false, [
  17708. [3, 0]
  17709. ]],
  17710. [-1, cr.system_object.prototype.acts.Wait, null, 0x7fac33d0e22b3, false, [
  17711. [0, [1, .3]]
  17712. ]],
  17713. [13, cr.plugins_.Sprite.prototype.acts.Destroy, null, 6848522201210278, false]
  17714. ]
  17715. ],
  17716. [0, null, false, null, 0x68438f5d3521d, [
  17717. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 8688892054803231, false, [
  17718. [11, "BestScore"],
  17719. [8, 2],
  17720. [7, [23, "Score"]]
  17721. ]]
  17722. ],
  17723. [
  17724. [-1, cr.system_object.prototype.acts.SetVar, null, 4678367891749245, false, [
  17725. [11, "BestScore"],
  17726. [7, [23, "Score"]]
  17727. ]],
  17728. [40, cr.plugins_.Text.prototype.acts.SetText, null, 0x96f97a098ceda, false, [
  17729. [7, [10, [2, "BEST:"],
  17730. [23, "BestScore"]
  17731. ]]
  17732. ]]
  17733. ]
  17734. ]
  17735. ]
  17736. ],
  17737. [0, null, false, null, 0xa865d71896731, [
  17738. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x662a6562ea833, false, [
  17739. [11, "CandyFontainIsActiveFor"],
  17740. [8, 4],
  17741. [7, [0, 180]]
  17742. ]]
  17743. ],
  17744. [
  17745. [-1, cr.system_object.prototype.acts.SetVar, null, 0xe9a5d8af191d7, false, [
  17746. [11, "CandyFontainIsActive"],
  17747. [7, [0, 0]]
  17748. ]],
  17749. [-1, cr.system_object.prototype.acts.SetVar, null, 0xd85c1436461d8, false, [
  17750. [11, "CandyFontainIsActiveFor"],
  17751. [7, [0, 0]]
  17752. ]],
  17753. [-1, cr.system_object.prototype.acts.SetVar, null, 6900889012332763, false, [
  17754. [11, "SpawnCandiesTime"],
  17755. [7, [1, .3]]
  17756. ]],
  17757. [-1, cr.system_object.prototype.acts.SetVar, null, 0xf22d14a307193, false, [
  17758. [11, "SpawnCandiesTimeRandOffset"],
  17759. [7, [1, .4]]
  17760. ]]
  17761. ]
  17762. ],
  17763. [0, null, true, null, 5487047525951067, [
  17764. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 9128310952291382, false, [
  17765. [3, 0],
  17766. [3, 0],
  17767. [4, 2]
  17768. ]],
  17769. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 0xa270138f2d55a, false, [
  17770. [4, 2]
  17771. ]]
  17772. ],
  17773. [],
  17774. [
  17775. [0, null, false, null, 0xfb7c71631c6d9, [
  17776. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0xdd7fc44ca2ad9, false, [
  17777. [11, "GameIsPaused"],
  17778. [8, 1],
  17779. [7, [0, 1]]
  17780. ]],
  17781. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 0x3aa2178966b15, false, [
  17782. [11, "SlomoIsActive"],
  17783. [8, 1],
  17784. [7, [0, 1]]
  17785. ]]
  17786. ],
  17787. [
  17788. [47, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x7d9ec894bfa8b, false],
  17789. [-1, cr.system_object.prototype.acts.CreateObject, null, 0xc8b938a3652bf, false, [
  17790. [4, 10],
  17791. [5, [0, 3]],
  17792. [0, [0, 0]],
  17793. [0, [0, 0]]
  17794. ]],
  17795. [-1, cr.system_object.prototype.acts.CreateObject, null, 7883074365350581, false, [
  17796. [4, 4],
  17797. [5, [0, 3]],
  17798. [0, [0, 160]],
  17799. [0, [0, 320]]
  17800. ]],
  17801. [-1, cr.system_object.prototype.acts.CreateObject, null, 4866026574519771, false, [
  17802. [4, 5],
  17803. [5, [0, 3]],
  17804. [0, [0, 270]],
  17805. [0, [0, 320]]
  17806. ]],
  17807. [-1, cr.system_object.prototype.acts.CreateObject, null, 5595954281785923, false, [
  17808. [4, 3],
  17809. [5, [0, 3]],
  17810. [0, [0, 50]],
  17811. [0, [0, 312]]
  17812. ]],
  17813. [-1, cr.system_object.prototype.acts.SetVar, null, 9857380323209656, false, [
  17814. [11, "GameIsPaused"],
  17815. [7, [0, 1]]
  17816. ]],
  17817. [-1, cr.system_object.prototype.acts.SetTimescale, null, 0x4832ec4ecae73, false, [
  17818. [0, [0, 0]]
  17819. ]]
  17820. ],
  17821. [
  17822. [0, null, false, null, 987321679636455, [
  17823. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 461848971484422, false, [
  17824. [11, "LANG"],
  17825. [8, 0],
  17826. [7, [2, "es"]]
  17827. ]]
  17828. ],
  17829. [
  17830. [10, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 0x5a548e1a5c4f1, false, [
  17831. [0, [0, 1]]
  17832. ]],
  17833. [10, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 6257676035305926, false]
  17834. ]
  17835. ],
  17836. [0, null, false, null, 8533215077023397, [
  17837. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 351158168306721, false]
  17838. ],
  17839. [
  17840. [10, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 6772709944771216, false, [
  17841. [0, [0, 0]]
  17842. ]],
  17843. [10, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 0x7ae5afc7a70b4, false]
  17844. ]
  17845. ]
  17846. ]
  17847. ]
  17848. ]
  17849. ],
  17850. [0, null, false, null, 7618354044431381, [
  17851. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 682706206605764, false, [
  17852. [11, "GameIsPaused"],
  17853. [8, 0],
  17854. [7, [0, 1]]
  17855. ]],
  17856. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 8581251821508217, false, [
  17857. [11, "TutCompleted"],
  17858. [8, 0],
  17859. [7, [0, 1]]
  17860. ]]
  17861. ],
  17862. [],
  17863. [
  17864. [0, null, true, null, 5963360395752128, [
  17865. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 7764284720252511, false, [
  17866. [3, 0],
  17867. [3, 0],
  17868. [4, 4]
  17869. ]],
  17870. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 6528850196822805, false, [
  17871. [4, 4]
  17872. ]]
  17873. ],
  17874. [
  17875. [10, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0x6457d57350518, false],
  17876. [4, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0xc7d6b6799b9d1, false],
  17877. [3, cr.plugins_.Sprite.prototype.acts.Destroy, null, 954771014095224, false],
  17878. [5, cr.plugins_.Sprite.prototype.acts.Destroy, null, 9532750981939328, false],
  17879. [13, cr.plugins_.Sprite.prototype.acts.Destroy, null, 6336411769876715, false],
  17880. [-1, cr.system_object.prototype.acts.SetTimescale, null, 9865563231120692, false, [
  17881. [0, [0, 1]]
  17882. ]],
  17883. [-1, cr.system_object.prototype.acts.Wait, null, 9954675901389412, false, [
  17884. [0, [1, .1]]
  17885. ]],
  17886. [-1, cr.system_object.prototype.acts.SetVar, null, 0x7cbdbaf76cf1b, false, [
  17887. [11, "GameIsPaused"],
  17888. [7, [0, 0]]
  17889. ]]
  17890. ]
  17891. ],
  17892. [0, null, true, null, 0x69adbb8c95acf, [
  17893. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 5511458766292623, false, [
  17894. [3, 0],
  17895. [3, 0],
  17896. [4, 3]
  17897. ]],
  17898. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 7041828015652946, false, [
  17899. [4, 3]
  17900. ]]
  17901. ],
  17902. [
  17903. [-1, cr.system_object.prototype.acts.SetTimescale, null, 7031147480559458, false, [
  17904. [0, [0, 1]]
  17905. ]],
  17906. [-1, cr.system_object.prototype.acts.SetVar, null, 6467285222596793, false, [
  17907. [11, "GameIsPaused"],
  17908. [7, [0, 1]]
  17909. ]],
  17910. [-1, cr.system_object.prototype.acts.CreateObject, null, 5895459652478379, false, [
  17911. [4, 13],
  17912. [5, [0, 4]],
  17913. [0, [0, 0]],
  17914. [0, [0, 0]]
  17915. ]],
  17916. [13, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 4823684816292579, false, [
  17917. [0, [0, 0]]
  17918. ]],
  17919. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "start", 9518766423616868, false, [
  17920. [3, 0]
  17921. ]],
  17922. [-1, cr.system_object.prototype.acts.Wait, null, 0x5682bd8e912a5, false, [
  17923. [0, [1, .3]]
  17924. ]],
  17925. [-1, cr.system_object.prototype.acts.GoToLayout, null, 0x61a0fa23d1213, false, [
  17926. [6, "StartScreen"]
  17927. ]]
  17928. ],
  17929. [
  17930. [0, null, false, null, 5011441429252481, [
  17931. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 6017079279329459, false, [
  17932. [11, "BestScore"],
  17933. [8, 2],
  17934. [7, [23, "Score"]]
  17935. ]]
  17936. ],
  17937. [
  17938. [-1, cr.system_object.prototype.acts.SetVar, null, 0x6b9328d61c751, false, [
  17939. [11, "BestScore"],
  17940. [7, [23, "Score"]]
  17941. ]]
  17942. ]
  17943. ]
  17944. ]
  17945. ]
  17946. ]
  17947. ]
  17948. ]],
  17949. ["Event sheet 2", [
  17950. [1, "LANG", 1, "en", false, false, 0x3d42155431732, false],
  17951. [0, null, false, null, 8298978542251967, [
  17952. [-1, cr.system_object.prototype.cnds.OnLayoutStart, null, 1, false, false, false, 0x9f602c8e8832d, false]
  17953. ],
  17954. [
  17955. [55, cr.plugins_.Browser.prototype.acts.ExecJs, null, 0xe67802c801f26, false, [
  17956. [1, [2, "window.c2_supportedLanguages = ['en','es']"]]
  17957. ]],
  17958. [44, cr.plugins_.Text.prototype.acts.Destroy, null, 0x914d2f2de3d3f, false],
  17959. [40, cr.plugins_.Text.prototype.acts.Destroy, null, 0x3d00d8ace84e2, false],
  17960. [43, cr.plugins_.Text.prototype.acts.Destroy, null, 9979753701666872, false],
  17961. [41, cr.plugins_.Text.prototype.acts.Destroy, null, 0xdba872566fd3a, false],
  17962. [45, cr.plugins_.Text.prototype.acts.Destroy, null, 7894499940711632, false],
  17963. [60, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 0xd3b64fcbc0ea1, false, [
  17964. [0, [0, 0]]
  17965. ]],
  17966. [3, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 887468358225114, false, [
  17967. [0, [0, 0]]
  17968. ]],
  17969. [-1, cr.system_object.prototype.acts.CreateObject, null, 4744460567821677, false, [
  17970. [4, 13],
  17971. [5, [0, 4]],
  17972. [0, [0, 0]],
  17973. [0, [0, 0]]
  17974. ]],
  17975. [13, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 5016145366944877, false, [
  17976. [0, [0, 100]]
  17977. ]],
  17978. [-1, cr.system_object.prototype.acts.Wait, null, 0xc949516e9759c, false, [
  17979. [0, [1, .5]]
  17980. ]],
  17981. [48, cr.plugins_.Softgames.prototype.acts.startGame, null, 4609597207707687, false],
  17982. [-1, cr.system_object.prototype.acts.Wait, null, 4950676714456789, false, [
  17983. [0, [1, .2]]
  17984. ]],
  17985. [-1, cr.system_object.prototype.acts.SetVar, null, 0xab020bb82950f, false, [
  17986. [11, "LANG"],
  17987. [7, [20, 48, cr.plugins_.Softgames.prototype.exps.getLanguage, true, null]]
  17988. ]]
  17989. ],
  17990. [
  17991. [0, null, false, null, 8051297272959024, [
  17992. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 5536045271514929, false, [
  17993. [11, "LANG"],
  17994. [8, 0],
  17995. [7, [2, ""]]
  17996. ]]
  17997. ],
  17998. [
  17999. [-1, cr.system_object.prototype.acts.SetVar, null, 0xb834d7ad090f4, false, [
  18000. [11, "LANG"],
  18001. [7, [2, "en"]]
  18002. ]]
  18003. ]
  18004. ],
  18005. [0, null, false, null, 8065023866466546, [
  18006. [-1, cr.system_object.prototype.cnds.CompareVar, null, 0, false, false, false, 727984559581866, false, [
  18007. [11, "LANG"],
  18008. [8, 0],
  18009. [7, [2, "es"]]
  18010. ]]
  18011. ],
  18012. [
  18013. [11, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 0x84befd2fe229f, false, [
  18014. [0, [0, 1]]
  18015. ]],
  18016. [11, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 0xce66befe0f453, false],
  18017. [54, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 0xa33e53bc71921, false, [
  18018. [7, [10, [2, "MEJOR:"],
  18019. [23, "BestScore"]
  18020. ]]
  18021. ]],
  18022. [60, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 6145553664488407, false, [
  18023. [0, [0, 0]]
  18024. ]],
  18025. [3, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 6600032657821854, false, [
  18026. [0, [0, 0]]
  18027. ]]
  18028. ]
  18029. ],
  18030. [0, null, false, null, 5019417563511174, [
  18031. [-1, cr.system_object.prototype.cnds.Else, null, 0, false, false, false, 0xea7fed5ce32db, false]
  18032. ],
  18033. [
  18034. [11, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, null, 0x7d58939635c34, false, [
  18035. [0, [0, 0]]
  18036. ]],
  18037. [11, cr.plugins_.Sprite.prototype.acts.StopAnim, null, 5897028323890919, false],
  18038. [54, cr.plugins_.Spritefont2.prototype.acts.SetText, null, 6175939483687864, false, [
  18039. [7, [10, [2, "BEST:"],
  18040. [23, "BestScore"]
  18041. ]]
  18042. ]],
  18043. [60, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 4734850290715652, false, [
  18044. [0, [0, 0]]
  18045. ]],
  18046. [3, cr.plugins_.Sprite.prototype.acts.SetOpacity, null, 6578289992069192, false, [
  18047. [0, [0, 0]]
  18048. ]]
  18049. ]
  18050. ],
  18051. [0, null, false, null, 4932213951698611, [],
  18052. [
  18053. [13, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "stop", 5550134621842616, false, [
  18054. [3, 0]
  18055. ]],
  18056. [-1, cr.system_object.prototype.acts.Wait, null, 7599427249119989, false, [
  18057. [0, [1, .3]]
  18058. ]],
  18059. [13, cr.plugins_.Sprite.prototype.acts.Destroy, null, 0xf4c6492a907b1, false]
  18060. ]
  18061. ]
  18062. ]
  18063. ],
  18064. [0, null, false, null, 4625974666721471, [
  18065. [11, cr.plugins_.Sprite.prototype.cnds.CompareOpacity, null, 0, false, false, false, 5020673556936083, false, [
  18066. [8, 0],
  18067. [0, [0, 0]]
  18068. ]]
  18069. ],
  18070. [],
  18071. [
  18072. [0, null, true, null, 0x90f6f0e7d8b0, [
  18073. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 5503964874402602, false, [
  18074. [3, 0],
  18075. [3, 0],
  18076. [4, 1]
  18077. ]],
  18078. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 8647999624876286, false, [
  18079. [4, 1]
  18080. ]]
  18081. ],
  18082. [
  18083. [-1, cr.system_object.prototype.acts.GoToLayoutByName, null, 0xbea59e679f36c, false, [
  18084. [1, [2, "GameScreen"]]
  18085. ]]
  18086. ]
  18087. ],
  18088. [0, null, true, null, 4751670721087094, [
  18089. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 5535365556802565, false, [
  18090. [3, 0],
  18091. [3, 0],
  18092. [4, 0]
  18093. ]],
  18094. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 0x4ead95f442c5b, false, [
  18095. [4, 0]
  18096. ]]
  18097. ],
  18098. [
  18099. [60, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "VisibilityTween", 962646812031931, false, [
  18100. [3, 0]
  18101. ]],
  18102. [3, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "VisibilityTween", 933718736408831, false, [
  18103. [3, 0]
  18104. ]]
  18105. ]
  18106. ]
  18107. ]
  18108. ],
  18109. [0, null, false, null, 0xe6521ac911a0c, [
  18110. [11, cr.plugins_.Sprite.prototype.cnds.CompareOpacity, null, 0, false, false, false, 8274953058219007, false, [
  18111. [8, 0],
  18112. [0, [0, 100]]
  18113. ]]
  18114. ],
  18115. [],
  18116. [
  18117. [0, null, true, null, 8015931174011678, [
  18118. [29, cr.plugins_.Mouse.prototype.cnds.OnObjectClicked, null, 1, false, false, false, 0x81157ebaa0b05, false, [
  18119. [3, 0],
  18120. [3, 0],
  18121. [4, 3]
  18122. ]],
  18123. [30, cr.plugins_.Touch.prototype.cnds.OnTouchObject, null, 1, false, false, false, 4786020213972257, false, [
  18124. [4, 3]
  18125. ]]
  18126. ],
  18127. [
  18128. [60, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "InvisibilityTween", 7263011076222217, false, [
  18129. [3, 0]
  18130. ]],
  18131. [3, cr.behaviors.lunarray_LiteTween.prototype.acts.Start, "InvisibilityTween", 336763197603131, false, [
  18132. [3, 0]
  18133. ]]
  18134. ]
  18135. ]
  18136. ]
  18137. ]
  18138. ]]
  18139. ], "media/", false, 320, 480, 4, true, true, true, "1.0", 1, false, 2, true, 60, true, []
  18140. ]
  18141. };
  18142. console.log(window)