123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749 |
- var isNeedFpsMeter = !1,
- isLevelEditor = !1,
- isSkipMenus = !1,
- isSkipReadyWin = !0,
- autoLevelToLoad = 1,
- isLastLevelLoad = !1,
- isDisableWin = !1,
- isOpenAllLevels = !1,
- openedLevels = 20,
- isPhysicsDebugDraw = !1,
- isGetAllProperties = !1,
- isLoadAnimFromJSON = !1,
- isSkipSplash = !0,
- isShowLogo = !0,
- isLevelSelectShow = !1,
- spriteScale = 1,
- isWithCache = !1,
- isTimerUpdateMode = !1,
- isPageLeaved = !1,
- isNeedHelperLabel = !1,
- isDesktopBrowser = !1,
- isLowQuality = !1,
- isDesignerSettingsPreferred = !0,
- STORAGE_PREFIX = "Soccer23",
- isMobileOnlyResize = !1,
- // SPONSOR_URL = "http://play68.com",
- PRELOADER_LOGO = "logo_spele.png",
- HERO_TYPE = 0,
- HERO_DOC_TYPE = 1,
- HERO_WOMAN_TYPE = 2,
- MONSTER_TYPE = 3,
- DECOR_BALK_1_TYPE = 21,
- DECOR_BALK_2_TYPE = 22,
- DECOR_BALK_3_TYPE = 23,
- DECOR_BALK_4_TYPE = 24,
- DECOR_BALK_5_TYPE = 25,
- DECOR_LAND_TYPE = 26,
- DECOR_HOUSE_TYPE = 27,
- DECOR_KUST_TYPE = 28,
- DECOR_ZABOR_TYPE = 29,
- DECOR_MELNICA_TYPE = 30,
- DECOR_MELNICA_ROT_TYPE = 31,
- DECOR_ARROW_TYPE = 32,
- DECOR_HOUSE_2_TYPE = 33,
- DECOR_COW_TYPE = 34,
- DECOR_CIRCUS_TYPE = 35,
- DECOR_HOUSE_3_TYPE = 36,
- DECOR_HOUSE_4_TYPE = 37,
- DECOR_BALK_6_TYPE = 38,
- DECOR_WINDOW_TYPE = 39,
- DECOR_CAT_1_TYPE =
- 40,
- DECOR_CAT_2_TYPE = 41,
- DECOR_GRAM_TYPE = 42,
- DECOR_PICT_1_TYPE = 43,
- DECOR_FLOWER_1_TYPE = 44,
- DECOR_VENT_TYPE = 45,
- DECOR_ELECTR_TYPE = 46,
- DECOR_DOOR_TYPE = 47,
- DECOR_PICT_2_TYPE = 48,
- DECOR_SVECHA_TYPE = 49,
- DECOR_TABLE_TYPE = 50,
- DECOR_STUL_TYPE = 51,
- DECOR_PICT_3_TYPE = 52,
- DECOR_VESHALKA_TYPE = 53,
- DECOR_VELO_TYPE = 54,
- DECOR_COVER_TYPE = 55,
- DECOR_BALK_7_TYPE = 56,
- DECOR_HELP_1_TYPE = 57,
- PHYSICS_RECT_TYPE = 100,
- DYNAMIC_BOX_TYPE = 101,
- TELEPORT_TYPE = 102,
- BOMB_TYPE = 103,
- DANGER_TYPE = 104,
- PHYSICS_MAN_BLOCK_TYPE = 105,
- PHYSICS_WOMAN_BLOCK_TYPE = 106,
- GLASS_BLOCK_TYPE =
- 107,
- ACTIVATOR_TYPE = 108,
- DOOR_TYPE = 109,
- DYNAMIC_CIRCLE_TYPE = 110,
- DYNAMIC_RECT_TYPE = 111,
- TELEGA_TYPE = 112,
- DYNAMIC_TRIANGLE_TYPE = 113,
- MOVABLE_BALK_TYPE = 114,
- FAN_TYPE = 115,
- GLASS_BOX_TYPE = 116,
- GLASS_TRIANGLE_TYPE = 117,
- HARD_BOX_TYPE = 118,
- HARD_RECT_TYPE = 119,
- HARD_TRIANGLE_TYPE = 120,
- STATIC_BALK_1_TYPE = 121,
- LAND_TYPE = 122,
- STATIC_BOX_TYPE = 123,
- BONUS_DIAMOND_TYPE = 201,
- BONUS_MONEY_TYPE = 202,
- BONUS_STAR_TYPE = 203,
- BONUS_GHOST_TYPE = 204,
- AIM_TYPE = 301,
- STATIC_CATEGORY = 1,
- WOMAN_CATEGORY = 2,
- MAN_CATEGORY = 4,
- WOMAN_BLOCK_CATEGORY = 8,
- MAN_BLOCK_CATEGORY =
- 16,
- FAN_ACTIV_DISTANCE = 130,
- FAN_MAX_FORCE = 40,
- GLASS_BREAK_VELOCITY = 70;
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, c, a) {
- this.initialize(b, c, a)
- },
- a = c.prototype;
- a.type = null;
- a.target = null;
- a.currentTarget = null;
- a.eventPhase = 0;
- a.bubbles = !1;
- a.cancelable = !1;
- a.timeStamp = 0;
- a.defaultPrevented = !1;
- a.propagationStopped = !1;
- a.immediatePropagationStopped = !1;
- a.removed = !1;
- a.initialize = function (b, c, a) {
- this.type = b;
- this.bubbles = c;
- this.cancelable = a;
- this.timeStamp = (new Date)
- .getTime()
- };
- a.preventDefault = function () {
- this.defaultPrevented = !0
- };
- a.stopPropagation = function () {
- this.propagationStopped = !0
- };
- a.stopImmediatePropagation =
- function () {
- this.immediatePropagationStopped = this.propagationStopped = !0
- };
- a.remove = function () {
- this.removed = !0
- };
- a.clone = function () {
- return new c(this.type, this.bubbles, this.cancelable)
- };
- a.toString = function () {
- return "[Event (type=" + this.type + ")]"
- };
- createjs.Event = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function () {},
- a = c.prototype;
- c.initialize = function (b) {
- b.addEventListener = a.addEventListener;
- b.on = a.on;
- b.removeEventListener = b.off = a.removeEventListener;
- b.removeAllEventListeners = a.removeAllEventListeners;
- b.hasEventListener = a.hasEventListener;
- b.dispatchEvent = a.dispatchEvent;
- b._dispatchEvent = a._dispatchEvent
- };
- a._listeners = null;
- a._captureListeners = null;
- a.initialize = function () {};
- a.addEventListener = function (b, c, a) {
- var d;
- d = a ? this._captureListeners = this._captureListeners || {} : this._listeners =
- this._listeners || {};
- var e = d[b];
- e && this.removeEventListener(b, c, a);
- (e = d[b]) ? e.push(c) : d[b] = [c];
- return c
- };
- a.on = function (b, c, a, d, e, h) {
- c.handleEvent && (a = a || c, c = c.handleEvent);
- a = a || this;
- return this.addEventListener(b, function (b) {
- c.call(a, b, e);
- d && b.remove()
- }, h)
- };
- a.removeEventListener = function (b, c, a) {
- if (a = a ? this._captureListeners : this._listeners) {
- var d = a[b];
- if (d)
- for (var e = 0, h = d.length; e < h; e++)
- if (d[e] == c) {
- 1 == h ? delete a[b] : d.splice(e, 1);
- break
- }
- }
- };
- a.off = a.removeEventListener;
- a.removeAllEventListeners = function (b) {
- b ?
- (this._listeners && delete this._listeners[b], this._captureListeners && delete this._captureListeners[b]) : this._listeners = this._captureListeners = null
- };
- a.dispatchEvent = function (b, c) {
- if ("string" == typeof b) {
- var a = this._listeners;
- if (!a || !a[b]) return !1;
- b = new createjs.Event(b)
- }
- b.target = c || this;
- if (b.bubbles && this.parent) {
- for (var d = this, a = [d]; d.parent;) a.push(d = d.parent);
- for (var e = a.length, d = e - 1; 0 <= d && !b.propagationStopped; d--) a[d]._dispatchEvent(b, 1 + (0 == d));
- for (d = 1; d < e && !b.propagationStopped; d++) a[d]._dispatchEvent(b,
- 3)
- } else this._dispatchEvent(b, 2);
- return b.defaultPrevented
- };
- a.hasEventListener = function (b) {
- var c = this._listeners,
- a = this._captureListeners;
- return !!(c && c[b] || a && a[b])
- };
- a.toString = function () {
- return "[EventDispatcher]"
- };
- a._dispatchEvent = function (b, c) {
- var a, d = 1 == c ? this._captureListeners : this._listeners;
- if (b && d && (d = d[b.type]) && (a = d.length)) {
- b.currentTarget = this;
- b.eventPhase = c;
- b.removed = !1;
- for (var d = d.slice(), e = 0; e < a && !b.immediatePropagationStopped; e++) {
- var h = d[e];
- h.handleEvent ? h.handleEvent(b) : h(b);
- b.removed &&
- (this.off(b.type, h, 1 == c), b.removed = !1)
- }
- }
- };
- createjs.EventDispatcher = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- createjs.indexOf = function (c, a) {
- for (var b = 0, g = c.length; b < g; b++)
- if (a === c[b]) return b;
- return -1
- }
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function () {
- throw "UID cannot be instantiated";
- };
- c._nextID = 0;
- c.get = function () {
- return c._nextID++
- };
- createjs.UID = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function () {
- throw "Ticker cannot be instantiated.";
- };
- c.RAF_SYNCHED = "synched";
- c.RAF = "raf";
- c.TIMEOUT = "timeout";
- c.useRAF = !1;
- c.timingMode = null;
- c.maxDelta = 60;
- c.removeEventListener = null;
- c.removeAllEventListeners = null;
- c.dispatchEvent = null;
- c.hasEventListener = null;
- c._listeners = null;
- createjs.EventDispatcher.initialize(c);
- c._addEventListener = c.addEventListener;
- c.addEventListener = function () {
- !c._inited && c.init();
- return c._addEventListener.apply(c, arguments)
- };
- c._paused = !1;
- c._inited = !1;
- c._startTime =
- 0;
- c._pausedTime = 0;
- c._ticks = 0;
- c._pausedTicks = 0;
- c._interval = 50;
- c._lastTime = 0;
- c._times = [];
- c._tickTimes = [];
- c._timerId = null;
- c._raf = !0;
- c._isFirstInit = !0;
- c.init = function () {
- c._inited || (c._timerId = null, c._inited = !0, c._isFirstInit = !1, c._times = [], c._tickTimes = [], c._startTime = c._getTime(), c._times.push(c._lastTime = 0), c.setInterval(c._interval))
- };
- c.reset = function () {
- c._inited = !1;
- if (c._raf) {
- var b = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame ||
- window.msCancelAnimationFrame;
- b && b(c._timerId)
- } else clearTimeout(c._timerId)
- };
- c.setInterval = function (b) {
- c._interval = b;
- c._inited && c._setupTick()
- };
- c.getInterval = function () {
- return c._interval
- };
- c.setFPS = function (b) {
- c.setInterval(1E3 / b)
- };
- c.getFPS = function () {
- return 1E3 / c._interval
- };
- c.getMeasuredTickTime = function (b) {
- var a = 0,
- f = c._tickTimes;
- if (1 > f.length) return -1;
- b = Math.min(f.length, b || c.getFPS() | 0);
- for (var d = 0; d < b; d++) a += f[d];
- return a / b
- };
- c.getMeasuredFPS = function (b) {
- var a = c._times;
- if (2 > a.length) return -1;
- b = Math.min(a.length - 1, b || c.getFPS() | 0);
- return 1E3 / ((a[0] - a[b]) / b)
- };
- c.setPaused = function (b) {
- c._paused = b
- };
- c.getPaused = function () {
- return c._paused
- };
- c.getTime = function (b) {
- return c._getTime() - c._startTime - (b ? c._pausedTime : 0)
- };
- c.getEventTime = function (b) {
- return (c._lastTime || c._startTime) - (b ? c._pausedTime : 0)
- };
- c.getTicks = function (b) {
- return c._ticks - (b ? c._pausedTicks : 0)
- };
- c._handleSynch = function () {
- var b = c._getTime() - c._startTime;
- c._timerId = null;
- c._setupTick();
- b - c._lastTime >= 0.97 * (c._interval - 1) && c._tick()
- };
- c._handleRAF = function () {
- c._timerId = null;
- c._setupTick();
- c._tick()
- };
- c._handleTimeout = function () {
- c._timerId = null;
- c._setupTick();
- c._tick()
- };
- c._setupTick = function () {
- if (null != c._timerId) trace("duplicate");
- else {
- var b = c.timingMode || c.useRAF && c.RAF_SYNCHED;
- if (b == c.RAF_SYNCHED || b == c.RAF) {
- var a = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame;
- if (a) {
- c._timerId = a(b == c.RAF ? c._handleRAF : c._handleSynch);
- c._raf = !0;
- return
- }
- }
- c._raf = !1;
- c._timerId = setTimeout(c._handleTimeout, c._interval)
- }
- };
- c._tick = function () {
- var b = c._getTime() - c._startTime,
- a = b - c._lastTime,
- f = c._paused;
- c._ticks++;
- f && (c._pausedTicks++, c._pausedTime += a);
- c._lastTime = b;
- if (c.hasEventListener("tick")) {
- var d = new createjs.Event("tick"),
- e = c.maxDelta;
- d.delta = e && a > e ? e : a;
- d.paused = f;
- d.time = b;
- d.runTime = b - c._pausedTime;
- c.dispatchEvent(d)
- }
- for (c._tickTimes.unshift(c._getTime() - b); 100 < c._tickTimes.length;) c._tickTimes.pop();
- for (c._times.unshift(b); 100 < c._times.length;) c._times.pop()
- };
- var a = window.performance && (performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow);
- c._getTime = function () {
- return a && a.call(performance) || (new Date)
- .getTime()
- };
- createjs.Ticker = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, c, a, d, e, h, k, m, n, p) {
- this.initialize(b, c, a, d, e, h, k, m, n, p)
- },
- a = c.prototype = new createjs.Event;
- a.stageX = 0;
- a.stageY = 0;
- a.rawX = 0;
- a.rawY = 0;
- a.nativeEvent = null;
- a.pointerID = 0;
- a.primary = !1;
- a.addEventListener = null;
- a.removeEventListener = null;
- a.removeAllEventListeners = null;
- a.dispatchEvent = null;
- a.hasEventListener = null;
- a._listeners = null;
- createjs.EventDispatcher.initialize(a);
- a.Event_initialize = a.initialize;
- a.initialize = function (b, c, a, d, e, h, k, m, n, p) {
- this.Event_initialize(b, c, a);
- this.stageX =
- d;
- this.stageY = e;
- this.nativeEvent = h;
- this.pointerID = k;
- this.primary = m;
- this.rawX = null == n ? d : n;
- this.rawY = null == p ? e : p
- };
- a.clone = function () {
- return new c(this.type, this.bubbles, this.cancelable, this.stageX, this.stageY, this.target, this.nativeEvent, this.pointerID, this.primary, this.rawX, this.rawY)
- };
- a.toString = function () {
- return "[MouseEvent (type=" + this.type + " stageX=" + this.stageX + " stageY=" + this.stageY + ")]"
- };
- createjs.MouseEvent = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, c, a, d, e, h) {
- this.initialize(b, c, a, d, e, h)
- },
- a = c.prototype;
- c.identity = null;
- c.DEG_TO_RAD = Math.PI / 180;
- a.a = 1;
- a.b = 0;
- a.c = 0;
- a.d = 1;
- a.tx = 0;
- a.ty = 0;
- a.alpha = 1;
- a.shadow = null;
- a.compositeOperation = null;
- a.initialize = function (b, c, a, d, e, h) {
- this.a = null == b ? 1 : b;
- this.b = c || 0;
- this.c = a || 0;
- this.d = null == d ? 1 : d;
- this.tx = e || 0;
- this.ty = h || 0;
- return this
- };
- a.prepend = function (b, c, a, d, e, h) {
- var k = this.tx;
- if (1 != b || 0 != c || 0 != a || 1 != d) {
- var m = this.a,
- n = this.c;
- this.a = m * b + this.b * a;
- this.b = m * c + this.b * d;
- this.c = n * b + this.d *
- a;
- this.d = n * c + this.d * d
- }
- this.tx = k * b + this.ty * a + e;
- this.ty = k * c + this.ty * d + h;
- return this
- };
- a.append = function (b, c, a, d, e, h) {
- var k = this.a,
- m = this.b,
- n = this.c,
- p = this.d;
- this.a = b * k + c * n;
- this.b = b * m + c * p;
- this.c = a * k + d * n;
- this.d = a * m + d * p;
- this.tx = e * k + h * n + this.tx;
- this.ty = e * m + h * p + this.ty;
- return this
- };
- a.prependMatrix = function (b) {
- this.prepend(b.a, b.b, b.c, b.d, b.tx, b.ty);
- this.prependProperties(b.alpha, b.shadow, b.compositeOperation);
- return this
- };
- a.appendMatrix = function (b) {
- this.append(b.a, b.b, b.c, b.d, b.tx, b.ty);
- this.appendProperties(b.alpha,
- b.shadow, b.compositeOperation);
- return this
- };
- a.prependTransform = function (b, a, f, d, e, h, k, m, n) {
- if (e % 360) {
- var p = e * c.DEG_TO_RAD;
- e = Math.cos(p);
- p = Math.sin(p)
- } else e = 1, p = 0; if (m || n) this.tx -= m, this.ty -= n;
- h || k ? (h *= c.DEG_TO_RAD, k *= c.DEG_TO_RAD, this.prepend(e * f, p * f, -p * d, e * d, 0, 0), this.prepend(Math.cos(k), Math.sin(k), -Math.sin(h), Math.cos(h), b, a)) : this.prepend(e * f, p * f, -p * d, e * d, b, a);
- return this
- };
- a.appendTransform = function (b, a, f, d, e, h, k, m, n) {
- if (e % 360) {
- var p = e * c.DEG_TO_RAD;
- e = Math.cos(p);
- p = Math.sin(p)
- } else e = 1, p = 0;
- h ||
- k ? (h *= c.DEG_TO_RAD, k *= c.DEG_TO_RAD, this.append(Math.cos(k), Math.sin(k), -Math.sin(h), Math.cos(h), b, a), this.append(e * f, p * f, -p * d, e * d, 0, 0)) : this.append(e * f, p * f, -p * d, e * d, b, a);
- if (m || n) this.tx -= m * this.a + n * this.c, this.ty -= m * this.b + n * this.d;
- return this
- };
- a.rotate = function (b) {
- var c = Math.cos(b);
- b = Math.sin(b);
- var a = this.a,
- d = this.c,
- e = this.tx;
- this.a = a * c - this.b * b;
- this.b = a * b + this.b * c;
- this.c = d * c - this.d * b;
- this.d = d * b + this.d * c;
- this.tx = e * c - this.ty * b;
- this.ty = e * b + this.ty * c;
- return this
- };
- a.skew = function (b, a) {
- b *= c.DEG_TO_RAD;
- a *= c.DEG_TO_RAD;
- this.append(Math.cos(a), Math.sin(a), -Math.sin(b), Math.cos(b), 0, 0);
- return this
- };
- a.scale = function (b, c) {
- this.a *= b;
- this.d *= c;
- this.c *= b;
- this.b *= c;
- this.tx *= b;
- this.ty *= c;
- return this
- };
- a.translate = function (b, c) {
- this.tx += b;
- this.ty += c;
- return this
- };
- a.identity = function () {
- this.alpha = this.a = this.d = 1;
- this.b = this.c = this.tx = this.ty = 0;
- this.shadow = this.compositeOperation = null;
- return this
- };
- a.invert = function () {
- var b = this.a,
- c = this.b,
- a = this.c,
- d = this.d,
- e = this.tx,
- h = b * d - c * a;
- this.a = d / h;
- this.b = -c / h;
- this.c = -a /
- h;
- this.d = b / h;
- this.tx = (a * this.ty - d * e) / h;
- this.ty = -(b * this.ty - c * e) / h;
- return this
- };
- a.isIdentity = function () {
- return 0 == this.tx && 0 == this.ty && 1 == this.a && 0 == this.b && 0 == this.c && 1 == this.d
- };
- a.transformPoint = function (b, c, a) {
- a = a || {};
- a.x = b * this.a + c * this.c + this.tx;
- a.y = b * this.b + c * this.d + this.ty;
- return a
- };
- a.decompose = function (b) {
- null == b && (b = {});
- b.x = this.tx;
- b.y = this.ty;
- b.scaleX = Math.sqrt(this.a * this.a + this.b * this.b);
- b.scaleY = Math.sqrt(this.c * this.c + this.d * this.d);
- var a = Math.atan2(-this.c, this.d),
- f = Math.atan2(this.b,
- this.a);
- a == f ? (b.rotation = f / c.DEG_TO_RAD, 0 > this.a && 0 <= this.d && (b.rotation += 0 >= b.rotation ? 180 : -180), b.skewX = b.skewY = 0) : (b.skewX = a / c.DEG_TO_RAD, b.skewY = f / c.DEG_TO_RAD);
- return b
- };
- a.reinitialize = function (b, c, a, d, e, h, k, m, n) {
- this.initialize(b, c, a, d, e, h);
- this.alpha = null == k ? 1 : k;
- this.shadow = m;
- this.compositeOperation = n;
- return this
- };
- a.copy = function (b) {
- return this.reinitialize(b.a, b.b, b.c, b.d, b.tx, b.ty, b.alpha, b.shadow, b.compositeOperation)
- };
- a.appendProperties = function (b, c, a) {
- this.alpha *= b;
- this.shadow = c || this.shadow;
- this.compositeOperation = a || this.compositeOperation;
- return this
- };
- a.prependProperties = function (b, c, a) {
- this.alpha *= b;
- this.shadow = this.shadow || c;
- this.compositeOperation = this.compositeOperation || a;
- return this
- };
- a.clone = function () {
- return (new c)
- .copy(this)
- };
- a.toString = function () {
- return "[Matrix2D (a=" + this.a + " b=" + this.b + " c=" + this.c + " d=" + this.d + " tx=" + this.tx + " ty=" + this.ty + ")]"
- };
- c.identity = new c;
- createjs.Matrix2D = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, c) {
- this.initialize(b, c)
- },
- a = c.prototype;
- a.x = 0;
- a.y = 0;
- a.initialize = function (b, c) {
- this.x = null == b ? 0 : b;
- this.y = null == c ? 0 : c;
- return this
- };
- a.copy = function (b) {
- return this.initialize(b.x, b.y)
- };
- a.clone = function () {
- return new c(this.x, this.y)
- };
- a.toString = function () {
- return "[Point (x=" + this.x + " y=" + this.y + ")]"
- };
- createjs.Point = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, c, a, d) {
- this.initialize(b, c, a, d)
- },
- a = c.prototype;
- a.x = 0;
- a.y = 0;
- a.width = 0;
- a.height = 0;
- a.initialize = function (b, c, a, d) {
- this.x = b || 0;
- this.y = c || 0;
- this.width = a || 0;
- this.height = d || 0;
- return this
- };
- a.copy = function (b) {
- return this.initialize(b.x, b.y, b.width, b.height)
- };
- a.clone = function () {
- return new c(this.x, this.y, this.width, this.height)
- };
- a.toString = function () {
- return "[Rectangle (x=" + this.x + " y=" + this.y + " width=" + this.width + " height=" + this.height + ")]"
- };
- createjs.Rectangle = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, c, a, d, e, h, k) {
- this.initialize(b, c, a, d, e, h, k)
- },
- a = c.prototype;
- a.target = null;
- a.overLabel = null;
- a.outLabel = null;
- a.downLabel = null;
- a.play = !1;
- a._isPressed = !1;
- a._isOver = !1;
- a.initialize = function (b, c, a, d, e, h, k) {
- b.addEventListener && (this.target = b, b.cursor = "pointer", this.overLabel = null == a ? "over" : a, this.outLabel = null == c ? "out" : c, this.downLabel = null == d ? "down" : d, this.play = e, this.setEnabled(!0), this.handleEvent({}), h && (k && (h.actionsEnabled = !1, h.gotoAndStop && h.gotoAndStop(k)), b.hitArea = h))
- };
- a.setEnabled = function (b) {
- var c = this.target;
- b ? (c.addEventListener("rollover", this), c.addEventListener("rollout", this), c.addEventListener("mousedown", this), c.addEventListener("pressup", this)) : (c.removeEventListener("rollover", this), c.removeEventListener("rollout", this), c.removeEventListener("mousedown", this), c.removeEventListener("pressup", this))
- };
- a.toString = function () {
- return "[ButtonHelper]"
- };
- a.handleEvent = function (b) {
- var c = this.target;
- b = b.type;
- "mousedown" == b ? (this._isPressed = !0, b = this.downLabel) : "pressup" ==
- b ? (this._isPressed = !1, b = this._isOver ? this.overLabel : this.outLabel) : "rollover" == b ? (this._isOver = !0, b = this._isPressed ? this.downLabel : this.overLabel) : (this._isOver = !1, b = this._isPressed ? this.overLabel : this.outLabel);
- this.play ? c.gotoAndPlay && c.gotoAndPlay(b) : c.gotoAndStop && c.gotoAndStop(b)
- };
- createjs.ButtonHelper = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, c, a, d) {
- this.initialize(b, c, a, d)
- },
- a = c.prototype;
- c.identity = null;
- a.color = null;
- a.offsetX = 0;
- a.offsetY = 0;
- a.blur = 0;
- a.initialize = function (b, c, a, d) {
- this.color = b;
- this.offsetX = c;
- this.offsetY = a;
- this.blur = d
- };
- a.toString = function () {
- return "[Shadow]"
- };
- a.clone = function () {
- return new c(this.color, this.offsetX, this.offsetY, this.blur)
- };
- c.identity = new c("transparent", 0, 0, 0);
- createjs.Shadow = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b) {
- this.initialize(b)
- },
- a = c.prototype = new createjs.EventDispatcher;
- a.complete = !0;
- a.framerate = 0;
- a._animations = null;
- a._frames = null;
- a._images = null;
- a._data = null;
- a._loadCount = 0;
- a._frameHeight = 0;
- a._frameWidth = 0;
- a._numFrames = 0;
- a._regX = 0;
- a._regY = 0;
- a.initialize = function (b) {
- var c, a, d;
- if (null != b) {
- this.framerate = b.framerate || 0;
- if (b.images && 0 < (a = b.images.length))
- for (d = this._images = [], c = 0; c < a; c++) {
- var e = b.images[c];
- if ("string" == typeof e) {
- var h = e,
- e = document.createElement("img");
- e.src = h
- }
- d.push(e);
- e.getContext || e.complete || (this._loadCount++, this.complete = !1, function (b) {
- e.onload = function () {
- b._handleImageLoad()
- }
- }(this))
- }
- if (null != b.frames)
- if (b.frames instanceof Array)
- for (this._frames = [], d = b.frames, c = 0, a = d.length; c < a; c++) h = d[c], this._frames.push({
- image: this._images[h[4] ? h[4] : 0],
- rect: new createjs.Rectangle(h[0], h[1], h[2], h[3]),
- regX: h[5] || 0,
- regY: h[6] || 0
- });
- else a = b.frames, this._frameWidth = a.width, this._frameHeight = a.height, this._regX = a.regX || 0, this._regY = a.regY || 0, this._numFrames = a.count, 0 == this._loadCount &&
- this._calculateFrames();
- this._animations = [];
- if (null != (a = b.animations)) {
- this._data = {};
- for (var k in a) {
- b = {
- name: k
- };
- h = a[k];
- if ("number" == typeof h) d = b.frames = [h];
- else if (h instanceof Array)
- if (1 == h.length) b.frames = [h[0]];
- else
- for (b.speed = h[3], b.next = h[2], d = b.frames = [], c = h[0]; c <= h[1]; c++) d.push(c);
- else b.speed = h.speed, b.next = h.next, c = h.frames, d = b.frames = "number" == typeof c ? [c] : c.slice(0); if (!0 === b.next || void 0 === b.next) b.next = k;
- if (!1 === b.next || 2 > d.length && b.next == k) b.next = null;
- b.speed || (b.speed = 1);
- this._animations.push(k);
- this._data[k] = b
- }
- }
- }
- };
- a.getNumFrames = function (b) {
- if (null == b) return this._frames ? this._frames.length : this._numFrames;
- b = this._data[b];
- return null == b ? 0 : b.frames.length
- };
- a.getAnimations = function () {
- return this._animations.slice(0)
- };
- a.getAnimation = function (b) {
- return this._data[b]
- };
- a.getFrame = function (b) {
- var c;
- return this._frames && (c = this._frames[b]) ? c : null
- };
- a.getFrameBounds = function (b, c) {
- var a = this.getFrame(b);
- return a ? (c || new createjs.Rectangle)
- .initialize(-a.regX, -a.regY, a.rect.width, a.rect.height) : null
- };
- a.toString = function () {
- return "[SpriteSheet]"
- };
- a.clone = function () {
- var b = new c;
- b.complete = this.complete;
- b._animations = this._animations;
- b._frames = this._frames;
- b._images = this._images;
- b._data = this._data;
- b._frameHeight = this._frameHeight;
- b._frameWidth = this._frameWidth;
- b._numFrames = this._numFrames;
- b._loadCount = this._loadCount;
- return b
- };
- a._handleImageLoad = function () {
- 0 == --this._loadCount && (this._calculateFrames(), this.complete = !0, this.dispatchEvent("complete"))
- };
- a._calculateFrames = function () {
- if (!this._frames &&
- 0 != this._frameWidth) {
- this._frames = [];
- for (var b = 0, c = this._frameWidth, a = this._frameHeight, d = 0, e = this._images; d < e.length; d++) {
- for (var h = e[d], k = (h.width + 1) / c | 0, m = (h.height + 1) / a | 0, m = 0 < this._numFrames ? Math.min(this._numFrames - b, k * m) : k * m, n = 0; n < m; n++) this._frames.push({
- image: h,
- rect: new createjs.Rectangle(n % k * c, (n / k | 0) * a, c, a),
- regX: this._regX,
- regY: this._regY
- });
- b += m
- }
- this._numFrames = b
- }
- };
- createjs.SpriteSheet = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- function c(b, c, a) {
- this.f = b;
- this.params = c;
- this.path = null == a ? !0 : a
- }
- c.prototype.exec = function (b) {
- this.f.apply(b, this.params)
- };
- var a = function () {
- this.initialize()
- },
- b = a.prototype;
- a.getRGB = function (b, c, a, g) {
- null != b && null == a && (g = c, a = b & 255, c = b >> 8 & 255, b = b >> 16 & 255);
- return null == g ? "rgb(" + b + "," + c + "," + a + ")" : "rgba(" + b + "," + c + "," + a + "," + g + ")"
- };
- a.getHSL = function (b, c, a, g) {
- return null == g ? "hsl(" + b % 360 + "," + c + "%," + a + "%)" : "hsla(" + b % 360 + "," + c + "%," + a + "%," + g + ")"
- };
- a.Command = c;
- a.BASE_64 = {
- A: 0,
- B: 1,
- C: 2,
- D: 3,
- E: 4,
- F: 5,
- G: 6,
- H: 7,
- I: 8,
- J: 9,
- K: 10,
- L: 11,
- M: 12,
- N: 13,
- O: 14,
- P: 15,
- Q: 16,
- R: 17,
- S: 18,
- T: 19,
- U: 20,
- V: 21,
- W: 22,
- X: 23,
- Y: 24,
- Z: 25,
- a: 26,
- b: 27,
- c: 28,
- d: 29,
- e: 30,
- f: 31,
- g: 32,
- h: 33,
- i: 34,
- j: 35,
- k: 36,
- l: 37,
- m: 38,
- n: 39,
- o: 40,
- p: 41,
- q: 42,
- r: 43,
- s: 44,
- t: 45,
- u: 46,
- v: 47,
- w: 48,
- x: 49,
- y: 50,
- z: 51,
- 0: 52,
- 1: 53,
- 2: 54,
- 3: 55,
- 4: 56,
- 5: 57,
- 6: 58,
- 7: 59,
- 8: 60,
- 9: 61,
- "+": 62,
- "/": 63
- };
- a.STROKE_CAPS_MAP = ["butt", "round", "square"];
- a.STROKE_JOINTS_MAP = ["miter", "round", "bevel"];
- var g = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
- if (g.getContext) {
- var f = a._ctx = g.getContext("2d");
- a.beginCmd = new c(f.beginPath, [], !1);
- a.fillCmd = new c(f.fill, [], !1);
- a.strokeCmd = new c(f.stroke, [], !1);
- g.width = g.height = 1
- }
- b._strokeInstructions = null;
- b._strokeStyleInstructions = null;
- b._strokeIgnoreScale = !1;
- b._fillInstructions = null;
- b._fillMatrix = null;
- b._instructions = null;
- b._oldInstructions = null;
- b._activeInstructions = null;
- b._active = !1;
- b._dirty = !1;
- b.initialize = function () {
- this.clear();
- this._ctx = a._ctx
- };
- b.isEmpty = function () {
- return !(this._instructions.length || this._oldInstructions.length || this._activeInstructions.length)
- };
- b.draw = function (b) {
- this._dirty && this._updateInstructions();
- for (var c = this._instructions, a = 0, g = c.length; a < g; a++) c[a].exec(b)
- };
- b.drawAsPath = function (b) {
- this._dirty && this._updateInstructions();
- for (var c, a = this._instructions, g = 0, f = a.length; g < f; g++)((c = a[g])
- .path || 0 == g) && c.exec(b)
- };
- b.moveTo = function (b, a) {
- this._activeInstructions.push(new c(this._ctx.moveTo, [b, a]));
- return this
- };
- b.lineTo = function (b, a) {
- this._dirty = this._active = !0;
- this._activeInstructions.push(new c(this._ctx.lineTo, [b, a]));
- return this
- };
- b.arcTo =
- function (b, a, g, f, m) {
- this._dirty = this._active = !0;
- this._activeInstructions.push(new c(this._ctx.arcTo, [b, a, g, f, m]));
- return this
- };
- b.arc = function (b, a, g, f, m, n) {
- this._dirty = this._active = !0;
- null == n && (n = !1);
- this._activeInstructions.push(new c(this._ctx.arc, [b, a, g, f, m, n]));
- return this
- };
- b.quadraticCurveTo = function (b, a, g, f) {
- this._dirty = this._active = !0;
- this._activeInstructions.push(new c(this._ctx.quadraticCurveTo, [b, a, g, f]));
- return this
- };
- b.bezierCurveTo = function (b, a, g, f, m, n) {
- this._dirty = this._active = !0;
- this._activeInstructions.push(new c(this._ctx.bezierCurveTo, [b, a, g, f, m, n]));
- return this
- };
- b.rect = function (b, a, g, f) {
- this._dirty = this._active = !0;
- this._activeInstructions.push(new c(this._ctx.rect, [b, a, g, f]));
- return this
- };
- b.closePath = function () {
- this._active && (this._dirty = !0, this._activeInstructions.push(new c(this._ctx.closePath, [])));
- return this
- };
- b.clear = function () {
- this._instructions = [];
- this._oldInstructions = [];
- this._activeInstructions = [];
- this._strokeStyleInstructions = this._strokeInstructions = this._fillInstructions = this._fillMatrix = null;
- this._active = this._dirty =
- this._strokeIgnoreScale = !1;
- return this
- };
- b.beginFill = function (b) {
- this._active && this._newPath();
- this._fillInstructions = b ? [new c(this._setProp, ["fillStyle", b], !1)] : null;
- this._fillMatrix = null;
- return this
- };
- b.beginLinearGradientFill = function (b, a, g, f, m, n) {
- this._active && this._newPath();
- g = this._ctx.createLinearGradient(g, f, m, n);
- f = 0;
- for (m = b.length; f < m; f++) g.addColorStop(a[f], b[f]);
- this._fillInstructions = [new c(this._setProp, ["fillStyle", g], !1)];
- this._fillMatrix = null;
- return this
- };
- b.beginRadialGradientFill = function (b,
- a, g, f, m, n, p, r) {
- this._active && this._newPath();
- g = this._ctx.createRadialGradient(g, f, m, n, p, r);
- f = 0;
- for (m = b.length; f < m; f++) g.addColorStop(a[f], b[f]);
- this._fillInstructions = [new c(this._setProp, ["fillStyle", g], !1)];
- this._fillMatrix = null;
- return this
- };
- b.beginBitmapFill = function (b, a, g) {
- this._active && this._newPath();
- b = this._ctx.createPattern(b, a || "");
- this._fillInstructions = [new c(this._setProp, ["fillStyle", b], !1)];
- this._fillMatrix = g ? [g.a, g.b, g.c, g.d, g.tx, g.ty] : null;
- return this
- };
- b.endFill = function () {
- return this.beginFill()
- };
- b.setStrokeStyle = function (b, g, f, k, m) {
- this._active && this._newPath();
- this._strokeStyleInstructions = [new c(this._setProp, ["lineWidth", null == b ? "1" : b], !1), new c(this._setProp, ["lineCap", null == g ? "butt" : isNaN(g) ? g : a.STROKE_CAPS_MAP[g]], !1), new c(this._setProp, ["lineJoin", null == f ? "miter" : isNaN(f) ? f : a.STROKE_JOINTS_MAP[f]], !1), new c(this._setProp, ["miterLimit", null == k ? "10" : k], !1)];
- this._strokeIgnoreScale = m;
- return this
- };
- b.beginStroke = function (b) {
- this._active && this._newPath();
- this._strokeInstructions = b ? [new c(this._setProp, ["strokeStyle", b], !1)] : null;
- return this
- };
- b.beginLinearGradientStroke = function (b, a, g, f, m, n) {
- this._active && this._newPath();
- g = this._ctx.createLinearGradient(g, f, m, n);
- f = 0;
- for (m = b.length; f < m; f++) g.addColorStop(a[f], b[f]);
- this._strokeInstructions = [new c(this._setProp, ["strokeStyle", g], !1)];
- return this
- };
- b.beginRadialGradientStroke = function (b, a, g, f, m, n, p, r) {
- this._active && this._newPath();
- g = this._ctx.createRadialGradient(g, f, m, n, p, r);
- f = 0;
- for (m = b.length; f < m; f++) g.addColorStop(a[f], b[f]);
- this._strokeInstructions = [new c(this._setProp, ["strokeStyle", g], !1)];
- return this
- };
- b.beginBitmapStroke = function (b, a) {
- this._active && this._newPath();
- var g = this._ctx.createPattern(b, a || "");
- this._strokeInstructions = [new c(this._setProp, ["strokeStyle", g], !1)];
- return this
- };
- b.endStroke = function () {
- this.beginStroke();
- return this
- };
- b.curveTo = b.quadraticCurveTo;
- b.drawRect = b.rect;
- b.drawRoundRect = function (b, a, c, g, f) {
- this.drawRoundRectComplex(b, a, c, g, f, f, f, f);
- return this
- };
- b.drawRoundRectComplex = function (b, a, g, f, m, n, p, r) {
- var s = (g < f ? g : f) /
- 2,
- t = 0,
- q = 0,
- w = 0,
- u = 0;
- 0 > m && (m *= t = -1);
- m > s && (m = s);
- 0 > n && (n *= q = -1);
- n > s && (n = s);
- 0 > p && (p *= w = -1);
- p > s && (p = s);
- 0 > r && (r *= u = -1);
- r > s && (r = s);
- this._dirty = this._active = !0;
- var s = this._ctx.arcTo,
- x = this._ctx.lineTo;
- this._activeInstructions.push(new c(this._ctx.moveTo, [b + g - n, a]), new c(s, [b + g + n * q, a - n * q, b + g, a + n, n]), new c(x, [b + g, a + f - p]), new c(s, [b + g + p * w, a + f + p * w, b + g - p, a + f, p]), new c(x, [b + r, a + f]), new c(s, [b - r * u, a + f + r * u, b, a + f - r, r]), new c(x, [b, a + m]), new c(s, [b - m * t, a - m * t, b + m, a, m]), new c(this._ctx.closePath));
- return this
- };
- b.drawCircle =
- function (b, a, c) {
- this.arc(b, a, c, 0, 2 * Math.PI);
- return this
- };
- b.drawEllipse = function (b, a, g, f) {
- this._dirty = this._active = !0;
- var m = 0.5522848 * (g / 2),
- n = 0.5522848 * (f / 2),
- p = b + g,
- r = a + f;
- g = b + g / 2;
- f = a + f / 2;
- this._activeInstructions.push(new c(this._ctx.moveTo, [b, f]), new c(this._ctx.bezierCurveTo, [b, f - n, g - m, a, g, a]), new c(this._ctx.bezierCurveTo, [g + m, a, p, f - n, p, f]), new c(this._ctx.bezierCurveTo, [p, f + n, g + m, r, g, r]), new c(this._ctx.bezierCurveTo, [g - m, r, b, f + n, b, f]));
- return this
- };
- b.inject = function (b, a) {
- this._dirty = this._active = !0;
- this._activeInstructions.push(new c(b, [a]));
- return this
- };
- b.drawPolyStar = function (b, a, g, f, m, n) {
- this._dirty = this._active = !0;
- null == m && (m = 0);
- m = 1 - m;
- n = null == n ? 0 : n / (180 / Math.PI);
- var p = Math.PI / f;
- this._activeInstructions.push(new c(this._ctx.moveTo, [b + Math.cos(n) * g, a + Math.sin(n) * g]));
- for (var r = 0; r < f; r++) n += p, 1 != m && this._activeInstructions.push(new c(this._ctx.lineTo, [b + Math.cos(n) * g * m, a + Math.sin(n) * g * m])), n += p, this._activeInstructions.push(new c(this._ctx.lineTo, [b + Math.cos(n) * g, a + Math.sin(n) * g]));
- return this
- };
- b.decodePath = function (b) {
- for (var c = [this.moveTo, this.lineTo, this.quadraticCurveTo, this.bezierCurveTo, this.closePath], g = [2, 2, 4, 6, 0], f = 0, m = b.length, n = [], p = 0, r = 0, s = a.BASE_64; f < m;) {
- var t = b.charAt(f),
- q = s[t],
- w = q >> 3,
- u = c[w];
- if (!u || q & 3) throw "bad path data (@" + f + "): " + t;
- t = g[w];
- w || (p = r = 0);
- n.length = 0;
- f++;
- q = (q >> 2 & 1) + 2;
- for (w = 0; w < t; w++) {
- var x = s[b.charAt(f)],
- K = x >> 5 ? -1 : 1,
- x = (x & 31) << 6 | s[b.charAt(f + 1)];
- 3 == q && (x = x << 6 | s[b.charAt(f + 2)]);
- x = K * x / 10;
- w % 2 ? p = x += p : r = x += r;
- n[w] = x;
- f += q
- }
- u.apply(this, n)
- }
- return this
- };
- b.clone = function () {
- var b =
- new a;
- b._instructions = this._instructions.slice();
- b._activeInstructions = this._activeInstructions.slice();
- b._oldInstructions = this._oldInstructions.slice();
- this._fillInstructions && (b._fillInstructions = this._fillInstructions.slice());
- this._strokeInstructions && (b._strokeInstructions = this._strokeInstructions.slice());
- this._strokeStyleInstructions && (b._strokeStyleInstructions = this._strokeStyleInstructions.slice());
- b._active = this._active;
- b._dirty = this._dirty;
- b._fillMatrix = this._fillMatrix;
- b._strokeIgnoreScale =
- this._strokeIgnoreScale;
- return b
- };
- b.toString = function () {
- return "[Graphics]"
- };
- b.mt = b.moveTo;
- b.lt = b.lineTo;
- b.at = b.arcTo;
- b.bt = b.bezierCurveTo;
- b.qt = b.quadraticCurveTo;
- b.a = b.arc;
- b.r = b.rect;
- b.cp = b.closePath;
- b.c = b.clear;
- b.f = b.beginFill;
- b.lf = b.beginLinearGradientFill;
- b.rf = b.beginRadialGradientFill;
- b.bf = b.beginBitmapFill;
- b.ef = b.endFill;
- b.ss = b.setStrokeStyle;
- b.s = b.beginStroke;
- b.ls = b.beginLinearGradientStroke;
- b.rs = b.beginRadialGradientStroke;
- b.bs = b.beginBitmapStroke;
- b.es = b.endStroke;
- b.dr = b.drawRect;
- b.rr = b.drawRoundRect;
- b.rc = b.drawRoundRectComplex;
- b.dc = b.drawCircle;
- b.de = b.drawEllipse;
- b.dp = b.drawPolyStar;
- b.p = b.decodePath;
- b._updateInstructions = function () {
- this._instructions = this._oldInstructions.slice();
- this._instructions.push(a.beginCmd);
- this._appendInstructions(this._fillInstructions);
- this._appendInstructions(this._strokeInstructions);
- this._appendInstructions(this._strokeInstructions && this._strokeStyleInstructions);
- this._appendInstructions(this._activeInstructions);
- this._fillInstructions && this._appendDraw(a.fillCmd,
- this._fillMatrix);
- this._strokeInstructions && this._appendDraw(a.strokeCmd, this._strokeIgnoreScale && [1, 0, 0, 1, 0, 0])
- };
- b._appendInstructions = function (b) {
- b && this._instructions.push.apply(this._instructions, b)
- };
- b._appendDraw = function (b, a) {
- a ? this._instructions.push(new c(this._ctx.save, [], !1), new c(this._ctx.transform, a, !1), b, new c(this._ctx.restore, [], !1)) : this._instructions.push(b)
- };
- b._newPath = function () {
- this._dirty && this._updateInstructions();
- this._oldInstructions = this._instructions;
- this._activeInstructions = [];
- this._active = this._dirty = !1
- };
- b._setProp = function (b, a) {
- this[b] = a
- };
- createjs.Graphics = a
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function () {
- this.initialize()
- },
- a = c.prototype = new createjs.EventDispatcher;
- c.suppressCrossDomainErrors = !1;
- var b = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
- b.getContext && (c._hitTestCanvas = b, c._hitTestContext = b.getContext("2d"), b.width = b.height = 1);
- c._nextCacheID = 1;
- a.alpha = 1;
- a.cacheCanvas = null;
- a.id = -1;
- a.mouseEnabled = !0;
- a.name = null;
- a.parent = null;
- a.regX = 0;
- a.regY = 0;
- a.rotation = 0;
- a.scaleX = 1;
- a.scaleY = 1;
- a.skewX = 0;
- a.skewY = 0;
- a.shadow = null;
- a.visible = !0;
- a.x = 0;
- a.y = 0;
- a.compositeOperation = null;
- a.snapToPixel = !1;
- a.filters = null;
- a.cacheID = 0;
- a.mask = null;
- a.hitArea = null;
- a.cursor = null;
- a._cacheOffsetX = 0;
- a._cacheOffsetY = 0;
- a._cacheScale = 1;
- a._cacheDataURLID = 0;
- a._cacheDataURL = null;
- a._matrix = null;
- a._rectangle = null;
- a._bounds = null;
- a.initialize = function () {
- this.id = createjs.UID.get();
- this._matrix = new createjs.Matrix2D;
- this._rectangle = new createjs.Rectangle
- };
- a.isVisible = function () {
- return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY)
- };
- a.draw = function (b, a) {
- var c =
- this.cacheCanvas;
- if (a || !c) return !1;
- var e = this._cacheScale,
- h = this._cacheOffsetX,
- k = this._cacheOffsetY,
- m;
- if (m = this._applyFilterBounds(h, k, 0, 0)) h = m.x, k = m.y;
- b.drawImage(c, h, k, c.width / e, c.height / e);
- return !0
- };
- a.updateContext = function (b) {
- var a, c = this.mask;
- c && c.graphics && !c.graphics.isEmpty() && (a = c.getMatrix(c._matrix), b.transform(a.a, a.b, a.c, a.d, a.tx, a.ty), c.graphics.drawAsPath(b), b.clip(), a.invert(), b.transform(a.a, a.b, a.c, a.d, a.tx, a.ty));
- a = this._matrix.identity()
- .appendTransform(this.x, this.y, this.scaleX,
- this.scaleY, this.rotation, this.skewX, this.skewY, this.regX, this.regY);
- createjs.Stage._snapToPixelEnabled && this.snapToPixel ? b.transform(a.a, a.b, a.c, a.d, a.tx + 0.5 | 0, a.ty + 0.5 | 0) : b.transform(a.a, a.b, a.c, a.d, a.tx, a.ty);
- b.globalAlpha *= this.alpha;
- this.compositeOperation && (b.globalCompositeOperation = this.compositeOperation);
- this.shadow && this._applyShadow(b, this.shadow)
- };
- a.cache = function (b, a, c, e, h) {
- h = h || 1;
- this.cacheCanvas || (this.cacheCanvas = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"));
- this._cacheWidth = c;
- this._cacheHeight = e;
- this._cacheOffsetX = b;
- this._cacheOffsetY = a;
- this._cacheScale = h;
- this.updateCache()
- };
- a.updateCache = function (b) {
- var a = this.cacheCanvas,
- d = this._cacheScale,
- e = this._cacheOffsetX * d,
- h = this._cacheOffsetY * d,
- k = this._cacheWidth,
- m = this._cacheHeight,
- n;
- if (!a) throw "cache() must be called before updateCache()";
- var p = a.getContext("2d");
- if (n = this._applyFilterBounds(e, h, k, m)) e = n.x, h = n.y, k = n.width, m = n.height;
- k = Math.ceil(k * d);
- m = Math.ceil(m * d);
- k != a.width || m != a.height ? (a.width = k, a.height =
- m) : b || p.clearRect(0, 0, k + 1, m + 1);
- p.save();
- p.globalCompositeOperation = b;
- p.setTransform(d, 0, 0, d, -e, -h);
- this.draw(p, !0);
- this._applyFilters();
- p.restore();
- this.cacheID = c._nextCacheID++
- };
- a.uncache = function () {
- this._cacheDataURL = this.cacheCanvas = null;
- this.cacheID = this._cacheOffsetX = this._cacheOffsetY = 0;
- this._cacheScale = 1
- };
- a.getCacheDataURL = function () {
- if (!this.cacheCanvas) return null;
- this.cacheID != this._cacheDataURLID && (this._cacheDataURL = this.cacheCanvas.toDataURL());
- return this._cacheDataURL
- };
- a.getStage = function () {
- for (var b =
- this; b.parent;) b = b.parent;
- return b instanceof createjs.Stage ? b : null
- };
- a.localToGlobal = function (b, a) {
- var c = this.getConcatenatedMatrix(this._matrix);
- if (null == c) return null;
- c.append(1, 0, 0, 1, b, a);
- return new createjs.Point(c.tx, c.ty)
- };
- a.globalToLocal = function (b, a) {
- var c = this.getConcatenatedMatrix(this._matrix);
- if (null == c) return null;
- c.invert();
- c.append(1, 0, 0, 1, b, a);
- return new createjs.Point(c.tx, c.ty)
- };
- a.localToLocal = function (b, a, c) {
- b = this.localToGlobal(b, a);
- return c.globalToLocal(b.x, b.y)
- };
- a.setTransform =
- function (b, a, c, e, h, k, m, n, p) {
- this.x = b || 0;
- this.y = a || 0;
- this.scaleX = null == c ? 1 : c;
- this.scaleY = null == e ? 1 : e;
- this.rotation = h || 0;
- this.skewX = k || 0;
- this.skewY = m || 0;
- this.regX = n || 0;
- this.regY = p || 0;
- return this
- };
- a.getMatrix = function (b) {
- return (b ? b.identity() : new createjs.Matrix2D)
- .appendTransform(this.x, this.y, this.scaleX, this.scaleY, this.rotation, this.skewX, this.skewY, this.regX, this.regY)
- .appendProperties(this.alpha, this.shadow, this.compositeOperation)
- };
- a.getConcatenatedMatrix = function (b) {
- b ? b.identity() : b = new createjs.Matrix2D;
- for (var a = this; null != a;) b.prependTransform(a.x, a.y, a.scaleX, a.scaleY, a.rotation, a.skewX, a.skewY, a.regX, a.regY)
- .prependProperties(a.alpha, a.shadow, a.compositeOperation), a = a.parent;
- return b
- };
- a.hitTest = function (b, a) {
- var d = c._hitTestContext;
- d.setTransform(1, 0, 0, 1, -b, -a);
- this.draw(d);
- var e = this._testHit(d);
- d.setTransform(1, 0, 0, 1, 0, 0);
- d.clearRect(0, 0, 2, 2);
- return e
- };
- a.set = function (b) {
- for (var a in b) this[a] = b[a];
- return this
- };
- a.getBounds = function () {
- if (this._bounds) return this._rectangle.copy(this._bounds);
- var b = this.cacheCanvas;
- if (b) {
- var a = this._cacheScale;
- return this._rectangle.initialize(this._cacheOffsetX, this._cacheOffsetY, b.width / a, b.height / a)
- }
- return null
- };
- a.getTransformedBounds = function () {
- return this._getBounds()
- };
- a.setBounds = function (b, a, c, e) {
- null == b && (this._bounds = b);
- this._bounds = (this._bounds || new createjs.Rectangle)
- .initialize(b, a, c, e)
- };
- a.clone = function () {
- var b = new c;
- this.cloneProps(b);
- return b
- };
- a.toString = function () {
- return "[DisplayObject (name=" + this.name + ")]"
- };
- a.cloneProps = function (b) {
- b.alpha =
- this.alpha;
- b.name = this.name;
- b.regX = this.regX;
- b.regY = this.regY;
- b.rotation = this.rotation;
- b.scaleX = this.scaleX;
- b.scaleY = this.scaleY;
- b.shadow = this.shadow;
- b.skewX = this.skewX;
- b.skewY = this.skewY;
- b.visible = this.visible;
- b.x = this.x;
- b.y = this.y;
- b._bounds = this._bounds;
- b.mouseEnabled = this.mouseEnabled;
- b.compositeOperation = this.compositeOperation
- };
- a._applyShadow = function (b, a) {
- a = a || Shadow.identity;
- b.shadowColor = a.color;
- b.shadowOffsetX = a.offsetX;
- b.shadowOffsetY = a.offsetY;
- b.shadowBlur = a.blur
- };
- a._tick = function (b) {
- var a =
- this._listeners;
- a && a.tick && (a = new createjs.Event("tick"), a.params = b, this._dispatchEvent(a, this, 2))
- };
- a._testHit = function (b) {
- try {
- var a = 1 < b.getImageData(0, 0, 1, 1)
- .data[3]
- } catch (d) {
- if (!c.suppressCrossDomainErrors) throw "An error has occurred. This is most likely due to security restrictions on reading canvas pixel data with local or cross-domain images.";
- }
- return a
- };
- a._applyFilters = function () {
- if (this.filters && 0 != this.filters.length && this.cacheCanvas)
- for (var b = this.filters.length, a = this.cacheCanvas.getContext("2d"),
- c = this.cacheCanvas.width, e = this.cacheCanvas.height, h = 0; h < b; h++) this.filters[h].applyFilter(a, 0, 0, c, e)
- };
- a._applyFilterBounds = function (b, a, c, e) {
- var h, k, m = this.filters;
- if (m && (k = m.length)) {
- for (m = 0; m < k; m++) {
- var n = this.filters[m];
- if (n = n.getBounds && n.getBounds()) h || (h = this._rectangle.initialize(b, a, c, e)), h.x += n.x, h.y += n.y, h.width += n.width, h.height += n.height
- }
- return h
- }
- };
- a._getBounds = function (b, a) {
- return this._transformBounds(this.getBounds(), b, a)
- };
- a._transformBounds = function (b, a, c) {
- if (!b) return b;
- var e = b.x,
- h = b.y,
- k = b.width,
- m = b.height,
- n = c ? this._matrix.identity() : this.getMatrix(this._matrix);
- (e || h) && n.appendTransform(0, 0, 1, 1, 0, 0, 0, -e, -h);
- a && n.prependMatrix(a);
- a = k * n.a;
- k *= n.b;
- c = m * n.c;
- var m = m * n.d,
- p = n.tx,
- n = n.ty,
- r = p,
- s = p,
- t = n,
- q = n;
- (e = a + p) < r ? r = e : e > s && (s = e);
- (e = a + c + p) < r ? r = e : e > s && (s = e);
- (e = c + p) < r ? r = e : e > s && (s = e);
- (h = k + n) < t ? t = h : h > q && (q = h);
- (h = k + m + n) < t ? t = h : h > q && (q = h);
- (h = m + n) < t ? t = h : h > q && (q = h);
- return b.initialize(r, t, s - r, q - t)
- };
- a.isRoot = !1;
- a.bounding_box = null;
- a.isCheckMouseWithDraw = !1;
- a.isOnlyBoundsCheck = !1;
- a.setBoundingBox =
- function (b, a, c, e) {
- return this.bounding_box = new createjs.Rectangle(b, a, c, e)
- };
- createjs.DisplayObject = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function () {
- this.initialize()
- },
- a = c.prototype = new createjs.DisplayObject;
- a.children = null;
- a.mouseChildren = !0;
- a.DisplayObject_initialize = a.initialize;
- a.initialize = function () {
- this.DisplayObject_initialize();
- this.children = []
- };
- a.isVisible = function () {
- var b = this.cacheCanvas || this.children.length;
- return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY && b)
- };
- a.DisplayObject_draw = a.draw;
- a.draw = function (b, a) {
- if (this.DisplayObject_draw(b, a)) return !0;
- for (var c = this.children.slice(0),
- d = 0, e = c.length; d < e; d++) {
- var h = c[d];
- h.isVisible() && (b.save(), h.updateContext(b), h.draw(b), b.restore())
- }
- return !0
- };
- a.addChild = function (b) {
- if (null == b) return b;
- var a = arguments.length;
- if (1 < a) {
- for (var c = 0; c < a; c++) this.addChild(arguments[c]);
- return arguments[a - 1]
- }
- b.parent && b.parent.removeChild(b);
- b.parent = this;
- this.children.push(b);
- return b
- };
- a.addChildAt = function (b, a) {
- var c = arguments.length,
- d = arguments[c - 1];
- if (0 > d || d > this.children.length) return arguments[c - 2];
- if (2 < c) {
- for (var e = 0; e < c - 1; e++) this.addChildAt(arguments[e],
- d + e);
- return arguments[c - 2]
- }
- b.parent && b.parent.removeChild(b);
- b.parent = this;
- this.children.splice(a, 0, b);
- return b
- };
- a.removeChild = function (b) {
- var a = arguments.length;
- if (1 < a) {
- for (var c = !0, d = 0; d < a; d++) c = c && this.removeChild(arguments[d]);
- return c
- }
- return this.removeChildAt(createjs.indexOf(this.children, b))
- };
- a.removeChildAt = function (b) {
- var a = arguments.length;
- if (1 < a) {
- for (var c = [], d = 0; d < a; d++) c[d] = arguments[d];
- c.sort(function (b, a) {
- return a - b
- });
- for (var e = !0, d = 0; d < a; d++) e = e && this.removeChildAt(c[d]);
- return e
- }
- if (0 >
- b || b > this.children.length - 1) return !1;
- if (a = this.children[b]) a.parent = null;
- this.children.splice(b, 1);
- return !0
- };
- a.removeAllChildren = function () {
- for (var b = this.children; b.length;) b.pop()
- .parent = null
- };
- a.getChildAt = function (b) {
- return this.children[b]
- };
- a.getChildByName = function (b) {
- for (var a = this.children, c = 0, d = a.length; c < d; c++)
- if (a[c].name == b) return a[c];
- return null
- };
- a.sortChildren = function (b) {
- this.children.sort(b)
- };
- a.getChildIndex = function (b) {
- return createjs.indexOf(this.children, b)
- };
- a.getNumChildren = function () {
- return this.children.length
- };
- a.swapChildrenAt = function (b, a) {
- var c = this.children,
- d = c[b],
- e = c[a];
- d && e && (c[b] = e, c[a] = d)
- };
- a.swapChildren = function (b, a) {
- for (var c = this.children, d, e, h = 0, k = c.length; h < k && (c[h] == b && (d = h), c[h] == a && (e = h), null == d || null == e); h++);
- h != k && (c[d] = a, c[e] = b)
- };
- a.setChildIndex = function (b, a) {
- var c = this.children,
- d = c.length;
- if (!(b.parent != this || 0 > a || a >= d)) {
- for (var e = 0; e < d && c[e] != b; e++);
- e != d && e != a && (c.splice(e, 1), c.splice(a, 0, b))
- }
- };
- a.contains = function (b) {
- for (; b;) {
- if (b == this) return !0;
- b = b.parent
- }
- return !1
- };
- a.hitTest = function (b,
- a) {
- return null != this.getObjectUnderPoint(b, a)
- };
- a.getObjectsUnderPoint = function (b, a) {
- var c = [],
- d = this.localToGlobal(b, a);
- this._getObjectsUnderPoint(d.x, d.y, c);
- return c
- };
- a.getObjectUnderPoint = function (b, a) {
- var c = this.localToGlobal(b, a);
- return this._getObjectsUnderPoint(c.x, c.y)
- };
- a.DisplayObject_getBounds = a.getBounds;
- a.getBounds = function () {
- return this._getBounds(null, !0)
- };
- a.getTransformedBounds = function () {
- return this._getBounds()
- };
- a.clone = function (b) {
- var a = new c;
- this.cloneProps(a);
- if (b)
- for (var f = a.children = [], d = 0, e = this.children.length; d < e; d++) {
- var h = this.children[d].clone(b);
- h.parent = a;
- f.push(h)
- }
- return a
- };
- a.toString = function () {
- return "[Container (name=" + this.name + ")]"
- };
- a.DisplayObject__tick = a._tick;
- a._tick = function (b) {
- for (var a = this.children.length - 1; 0 <= a; a--) {
- var c = this.children[a];
- c._tick && c._tick(b)
- }
- this.DisplayObject__tick(b)
- };
- a._getObjectsUnderPoint = function (b, a, f, d) {
- var e, h;
- e = this.children.length;
- if (!isDesktopBrowser) {
- var k, m;
- for (e -= 1; 0 <= e; e--)
- if (h = this.children[e], h.visible && h.mouseEnabled &&
- !(0 >= h.alpha)) {
- if (k = h.bounding_box) {
- if (m = h.isRoot ? h.x + k.x <= b && b < h.x + k.x + k.width && h.y + k.y <= a && a < h.y + k.y + k.height : (h.x + k.x) * scaleFactor <= b && b < scaleFactor * (h.x + k.x + k.width) && (h.y + k.y) * scaleFactor <= a && a < scaleFactor * (h.y + k.y + k.height))
- if (f) {
- f.push(h);
- continue
- } else return h
- } else if (h.isCheckMouseWithDraw) {
- m = createjs.DisplayObject._hitTestContext;
- var n = this._matrix;
- k = d && h.hitArea;
- h.getConcatenatedMatrix(n);
- k && (n.appendTransform(k.x, k.y, k.scaleX, k.scaleY, k.rotation, k.skewX, k.skewY, k.regX, k.regY), n.alpha =
- k.alpha);
- m.globalAlpha = n.alpha;
- m.setTransform(n.a, n.b, n.c, n.d, n.tx - b, n.ty - a);
- (k || h)
- .draw(m);
- if (!this._testHit(m)) continue;
- m.setTransform(1, 0, 0, 1, 0, 0);
- m.clearRect(0, 0, 2, 2);
- if (f) f.push(h);
- else return d && !this.mouseChildren ? this : h
- }
- if (h instanceof c && (h = h.isRoot ? h._getObjectsUnderPoint(b - (h.x + h.regX), a - (h.y + h.regY), f, d) : h._getObjectsUnderPoint(b - (h.x + h.regX) * scaleFactor, a - (h.y + h.regY) * scaleFactor, f, d)))
- if (f) f.push(h);
- else return h
- }
- return null
- }
- m = createjs.DisplayObject._hitTestContext;
- n = this._matrix;
- for (e -=
- 1; 0 <= e; e--)
- if (h = this.children[e], k = d && h.hitArea, h.visible && (k || h.isVisible()) && (!d || h.mouseEnabled))
- if (!k && h instanceof c) {
- if (h = h._getObjectsUnderPoint(b, a, f, d), !f && h) return d && !this.mouseChildren ? this : h
- } else {
- h.getConcatenatedMatrix(n);
- k && (n.appendTransform(k.x, k.y, k.scaleX, k.scaleY, k.rotation, k.skewX, k.skewY, k.regX, k.regY), n.alpha = k.alpha);
- if (h.isOnlyBoundsCheck) {
- if ((k = h.bounding_box) && !((b - n.tx) / scaleFactor >= k.x && (b - n.tx) / scaleFactor <= k.x + k.width && (a - n.ty) / scaleFactor >= k.y && (a - n.ty) / scaleFactor <=
- k.y + k.height)) continue
- } else {
- m.globalAlpha = n.alpha;
- m.setTransform(n.a, n.b, n.c, n.d, n.tx - b, n.ty - a);
- (k || h)
- .draw(m);
- if (!this._testHit(m)) continue;
- m.setTransform(1, 0, 0, 1, 0, 0);
- m.clearRect(0, 0, 2, 2)
- } if (f) f.push(h);
- else return d && !this.mouseChildren ? this : h
- }
- return null
- };
- a._getBounds = function (b, a) {
- var c = this.DisplayObject_getBounds();
- if (c) return this._transformBounds(c, b, a);
- var d, e, h, k, m = a ? this._matrix.identity() : this.getMatrix(this._matrix);
- b && m.prependMatrix(b);
- for (var n = this.children.length, p = 0; p < n; p++) {
- var r =
- this.children[p];
- if (r.visible && (c = r._getBounds(m))) {
- var r = c.x,
- s = c.y,
- t = r + c.width,
- q = s + c.height;
- if (r < d || null == d) d = r;
- if (t > e || null == e) e = t;
- if (s < h || null == h) h = s;
- if (q > k || null == k) k = q
- }
- }
- return null == e ? null : this._rectangle.initialize(d, h, e - d, k - h)
- };
- createjs.Container = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b) {
- this.initialize(b)
- },
- a = c.prototype = new createjs.Container;
- c._snapToPixelEnabled = !1;
- a.autoClear = !0;
- a.canvas = null;
- a.mouseX = 0;
- a.mouseY = 0;
- a.snapToPixelEnabled = !1;
- a.mouseInBounds = !1;
- a.tickOnUpdate = !0;
- a.mouseMoveOutside = !1;
- a.nextStage = null;
- a._pointerData = null;
- a._pointerCount = 0;
- a._primaryPointerID = null;
- a._mouseOverIntervalID = null;
- a.Container_initialize = a.initialize;
- a.initialize = function (b) {
- this.Container_initialize();
- this.canvas = "string" == typeof b ? document.getElementById(b) :
- b;
- this._pointerData = {};
- this.enableDOMEvents(!0)
- };
- a.update = function (b) {
- if (this.canvas) {
- this.tickOnUpdate && (this.dispatchEvent("tickstart"), this._tick(arguments.length ? arguments : null), this.dispatchEvent("tickend"));
- this.dispatchEvent("drawstart");
- c._snapToPixelEnabled = this.snapToPixelEnabled;
- this.autoClear && this.clear();
- var a = this.canvas.getContext("2d");
- a.save();
- this.updateContext(a);
- this.draw(a, !1);
- a.restore();
- this.dispatchEvent("drawend")
- }
- };
- a.handleEvent = function (b) {
- "tick" == b.type && this.update(b)
- };
- a.clear = function () {
- if (this.canvas) {
- var b = this.canvas.getContext("2d");
- b.setTransform(1, 0, 0, 1, 0, 0);
- b.clearRect(0, 0, this.canvas.width + 1, this.canvas.height + 1)
- }
- };
- a.toDataURL = function (b, a) {
- a || (a = "image/png");
- var c = this.canvas.getContext("2d"),
- d = this.canvas.width,
- e = this.canvas.height,
- h;
- if (b) {
- h = c.getImageData(0, 0, d, e);
- var k = c.globalCompositeOperation;
- c.globalCompositeOperation = "destination-over";
- c.fillStyle = b;
- c.fillRect(0, 0, d, e)
- }
- var m = this.canvas.toDataURL(a);
- b && (c.clearRect(0, 0, d + 1, e + 1), c.putImageData(h,
- 0, 0), c.globalCompositeOperation = k);
- return m
- };
- a.enableMouseOver = function (b) {
- this._mouseOverIntervalID && (clearInterval(this._mouseOverIntervalID), this._mouseOverIntervalID = null, 0 == b && this._testMouseOver(!0));
- if (null == b) b = 20;
- else if (0 >= b) return;
- var a = this;
- this._mouseOverIntervalID = setInterval(function () {
- a._testMouseOver()
- }, 1E3 / Math.min(50, b))
- };
- a.enableDOMEvents = function (b) {
- null == b && (b = !0);
- var a, c = this._eventListeners;
- if (!b && c) {
- for (a in c) b = c[a], b.t.removeEventListener(a, b.f, !1);
- this._eventListeners =
- null
- } else if (b && !c && this.canvas) {
- b = window.addEventListener ? window : document;
- var d = this,
- c = this._eventListeners = {};
- c.mouseup = {
- t: b,
- f: function (b) {
- d._handleMouseUp(b)
- }
- };
- c.mousemove = {
- t: b,
- f: function (b) {
- d._handleMouseMove(b)
- }
- };
- c.dblclick = {
- t: b,
- f: function (b) {
- d._handleDoubleClick(b)
- }
- };
- c.mousedown = {
- t: this.canvas,
- f: function (b) {
- d._handleMouseDown(b)
- }
- };
- for (a in c) b = c[a], b.t.addEventListener(a, b.f, !1)
- }
- };
- a.clone = function () {
- var b = new c(null);
- this.cloneProps(b);
- return b
- };
- a.toString = function () {
- return "[Stage (name=" + this.name +
- ")]"
- };
- a._getElementRect = function (b) {
- var a;
- try {
- a = b.getBoundingClientRect()
- } catch (c) {
- a = {
- top: b.offsetTop,
- left: b.offsetLeft,
- width: b.offsetWidth,
- height: b.offsetHeight
- }
- }
- var d = (window.pageXOffset || document.scrollLeft || 0) - (document.clientLeft || document.body.clientLeft || 0),
- e = (window.pageYOffset || document.scrollTop || 0) - (document.clientTop || document.body.clientTop || 0),
- h = window.getComputedStyle ? getComputedStyle(b) : b.currentStyle;
- b = parseInt(h.paddingLeft) + parseInt(h.borderLeftWidth);
- var k = parseInt(h.paddingTop) +
- parseInt(h.borderTopWidth),
- m = parseInt(h.paddingRight) + parseInt(h.borderRightWidth),
- h = parseInt(h.paddingBottom) + parseInt(h.borderBottomWidth);
- return {
- left: a.left + d + b,
- right: a.right + d - m,
- top: a.top + e + k,
- bottom: a.bottom + e - h
- }
- };
- a._getPointerData = function (b) {
- var a = this._pointerData[b];
- a || (a = this._pointerData[b] = {
- x: 0,
- y: 0
- }, null != this._primaryPointerID && -1 != this._primaryPointerID) || (this._primaryPointerID = b);
- return a
- };
- a._handleMouseMove = function (b) {
- b || (b = window.event);
- this._handlePointerMove(-1, b, b.pageX, b.pageY)
- };
- a._handlePointerMove = function (b, a, c, d) {
- if (this.canvas) {
- var e = this._getPointerData(b),
- h = e.inBounds;
- this._updatePointerPosition(b, a, c, d);
- if (h || e.inBounds || this.mouseMoveOutside) - 1 == b && e.inBounds == !h && this._dispatchMouseEvent(this, h ? "mouseleave" : "mouseenter", !1, b, e, a), this._dispatchMouseEvent(this, "stagemousemove", !1, b, e, a), this._dispatchMouseEvent(e.target, "pressmove", !0, b, e, a), (h = e.event) && h.hasEventListener("mousemove") && h.dispatchEvent(new createjs.MouseEvent("mousemove", !1, !1, e.x, e.y, a, b, b == this._primaryPointerID,
- e.rawX, e.rawY), oTarget), this.nextStage && this.nextStage._handlePointerMove(b, a, c, d)
- }
- };
- a._updatePointerPosition = function (b, a, c, d) {
- var e = this._getElementRect(this.canvas);
- c -= e.left;
- d -= e.top;
- var h = this.canvas.width,
- k = this.canvas.height;
- c /= (e.right - e.left) / h;
- d /= (e.bottom - e.top) / k;
- e = this._getPointerData(b);
- (e.inBounds = 0 <= c && 0 <= d && c <= h - 1 && d <= k - 1) ? (e.x = c, e.y = d) : this.mouseMoveOutside && (e.x = 0 > c ? 0 : c > h - 1 ? h - 1 : c, e.y = 0 > d ? 0 : d > k - 1 ? k - 1 : d);
- e.posEvtObj = a;
- e.rawX = c;
- e.rawY = d;
- b == this._primaryPointerID && (this.mouseX = e.x,
- this.mouseY = e.y, this.mouseInBounds = e.inBounds)
- };
- a._handleMouseUp = function (b) {
- this._handlePointerUp(-1, b, !1)
- };
- a._handlePointerUp = function (b, a, c) {
- var d = this._getPointerData(b),
- e = d.target;
- e && (e.hasEventListener("pressup") || e.hasEventListener("click")) ? (e.hasEventListener("click") && this._getObjectsUnderPoint(d.x, d.y, null, !0) == e && this._dispatchMouseEvent(e, "click", !0, b, d, a), this._dispatchMouseEvent(e, "pressup", !0, b, d, a)) : this._dispatchMouseEvent(this, "stagemouseup", !1, b, d, a);
- c ? (b == this._primaryPointerID &&
- (this._primaryPointerID = null), delete this._pointerData[b]) : d.event = d.target = null;
- this.nextStage && this.nextStage._handlePointerUp(b, a, c)
- };
- a._handleMouseDown = function (b) {
- this._handlePointerDown(-1, b, b.pageX, b.pageY)
- };
- a._handlePointerDown = function (b, a, c, d) {
- null != d && this._updatePointerPosition(b, a, c, d);
- var e = this._getPointerData(b);
- e.target = this._getObjectsUnderPoint(e.x, e.y, null, !0);
- this._dispatchMouseEvent(e.target, "mousedown", !0, b, e, a);
- e.target && e.target.hasEventListener("mousedown") || this._dispatchMouseEvent(this,
- "stagemousedown", !1, b, e, a);
- this.nextStage && this.nextStage._handlePointerDown(b, a, c, d)
- };
- a._testMouseOver = function (b) {
- if (-1 == this._primaryPointerID && (b || this.mouseX != this._mouseOverX || this.mouseY != this._mouseOverY || !this.mouseInBounds)) {
- var a = this._getPointerData(-1),
- c = a.posEvtObj,
- d, e = -1,
- h = "",
- k;
- if (b || this.mouseInBounds && c && c.target == this.canvas) d = this._getObjectsUnderPoint(this.mouseX, this.mouseY, null, !0), this._mouseOverX = this.mouseX, this._mouseOverY = this.mouseY;
- b = this._mouseOverTarget || [];
- var m = b[b.length -
- 1],
- n = this._mouseOverTarget = [];
- for (k = d; k;) n.unshift(k), null != k.cursor && (h = k.cursor), k = k.parent;
- this.canvas.style.cursor = h;
- h = 0;
- for (k = n.length; h < k && n[h] == b[h]; h++) e = h;
- m != d && this._dispatchMouseEvent(m, "mouseout", !0, -1, a, c);
- for (h = b.length - 1; h > e; h--) this._dispatchMouseEvent(b[h], "rollout", !1, -1, a, c);
- for (h = n.length - 1; h > e; h--) this._dispatchMouseEvent(n[h], "rollover", !1, -1, a, c);
- m != d && this._dispatchMouseEvent(d, "mouseover", !0, -1, a, c)
- }
- };
- a._handleDoubleClick = function (b) {
- var a = this._getPointerData(-1),
- c = this._getObjectsUnderPoint(a.x,
- a.y, null, !0);
- this._dispatchMouseEvent(c, "dblclick", !0, -1, a, b);
- this.nextStage && this.nextStage._handleDoubleClick(b)
- };
- a._dispatchMouseEvent = function (b, a, c, d, e, h) {
- b && (c || b.hasEventListener(a)) && (a = new createjs.MouseEvent(a, c, !1, e.x, e.y, h, d, d == this._primaryPointerID, e.rawX, e.rawY), b.dispatchEvent(a))
- };
- createjs.Stage = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b) {
- this.initialize(b)
- },
- a = c.prototype = new createjs.DisplayObject;
- a.image = null;
- a.snapToPixel = !0;
- a.sourceRect = null;
- a.DisplayObject_initialize = a.initialize;
- a.initialize = function (b) {
- this.DisplayObject_initialize();
- "string" == typeof b ? (this.image = document.createElement("img"), this.image.src = b) : this.image = b
- };
- a.isVisible = function () {
- var b = this.cacheCanvas || this.image && (this.image.complete || this.image.getContext || 2 <= this.image.readyState);
- return !!(this.visible && 0 < this.alpha && 0 != this.scaleX &&
- 0 != this.scaleY && b)
- };
- a.DisplayObject_draw = a.draw;
- a.draw = function (b, a) {
- if (this.DisplayObject_draw(b, a)) return !0;
- var c = this.sourceRect;
- c ? b.drawImage(this.image, c.x, c.y, c.width, c.height, 0, 0, c.width, c.height) : b.drawImage(this.image, 0, 0);
- return !0
- };
- a.DisplayObject_getBounds = a.getBounds;
- a.getBounds = function () {
- var b = this.DisplayObject_getBounds();
- if (b) return b;
- b = this.sourceRect || this.image;
- return this.image && (this.image.complete || this.image.getContext || 2 <= this.image.readyState) ? this._rectangle.initialize(0,
- 0, b.width, b.height) : null
- };
- a.clone = function () {
- var b = new c(this.image);
- this.sourceRect && (b.sourceRect = this.sourceRect.clone());
- this.cloneProps(b);
- return b
- };
- a.toString = function () {
- return "[Bitmap (name=" + this.name + ")]"
- };
- createjs.Bitmap = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, a) {
- this.initialize(b, a)
- },
- a = c.prototype = new createjs.DisplayObject;
- a.currentFrame = 0;
- a.currentAnimation = null;
- a.paused = !0;
- a.spriteSheet = null;
- a.snapToPixel = !0;
- a.isLoop = !0;
- a.offset = 0;
- a.currentAnimationFrame = 0;
- a.framerate = 0;
- a._advanceCount = 0;
- a._animation = null;
- a._currentFrame = null;
- a.rectMask = null;
- a.DisplayObject_initialize = a.initialize;
- a.initialize = function (b, a) {
- this.DisplayObject_initialize();
- this.spriteSheet = b;
- a && this.gotoAndPlay(a)
- };
- a.isVisible = function () {
- var b = this.cacheCanvas ||
- this.spriteSheet.complete;
- return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY && b)
- };
- a.DisplayObject_draw = a.draw;
- a.draw = function (b, a) {
- if (this.DisplayObject_draw(b, a)) return !0;
- this._normalizeFrame();
- var c = this.spriteSheet.getFrame(this._currentFrame | 0);
- if (!c) return !1;
- var d = c.rect;
- this.rectMask ? b.drawImage(c.image, d.x + this.rectMask.x, d.y + this.rectMask.y, d.width + this.rectMask.width, d.height + this.rectMask.height, -c.regX + this.rectMask.x, -c.regY + this.rectMask.y, d.width + this.rectMask.width,
- d.height + this.rectMask.height) : 1 <= d.width && 1 <= d.height && b.drawImage(c.image, d.x, d.y, d.width, d.height, -c.regX, -c.regY, d.width, d.height);
- return !0
- };
- a.play = function () {
- this.paused = !1
- };
- a.stop = function () {
- this.paused = !0
- };
- a.gotoAndPlay = function (b) {
- this.paused = !1;
- this._goto(b)
- };
- a.gotoAndStop = function (b) {
- this.paused = !0;
- this._goto(b)
- };
- a.advance = function (b) {
- var a = this._animation && this._animation.speed || 1,
- c = this.framerate || this.spriteSheet.framerate;
- b = c && null != b ? b / (1E3 / c) : 1;
- this._animation ? this.currentAnimationFrame +=
- b * a : this._currentFrame += b * a;
- this._normalizeFrame()
- };
- a.DisplayObject_getBounds = a.getBounds;
- a.getBounds = function () {
- return this.DisplayObject_getBounds() || this.spriteSheet.getFrameBounds(this.currentFrame, this._rectangle)
- };
- a.clone = function () {
- var b = new c(this.spriteSheet);
- this.cloneProps(b);
- return b
- };
- a.toString = function () {
- return "[Sprite (name=" + this.name + ")]"
- };
- a.DisplayObject__tick = a._tick;
- a._tick = function (b) {
- this.paused || this.advance(b && b[0] && b[0].delta);
- this.DisplayObject__tick(b)
- };
- a._normalizeFrame =
- function () {
- var b = this._animation,
- a = this.paused,
- c = this._currentFrame,
- d = this.currentAnimationFrame,
- e;
- if (b)
- if (e = b.frames.length, (d | 0) >= e) {
- var h = b.next;
- if (!this._dispatchAnimationEnd(b, c, a, h, e - 1)) {
- if (h && this.isLoop) return this._goto(h, d - e);
- this.paused = !0;
- d = this.currentAnimationFrame = b.frames.length - 1;
- this._currentFrame = b.frames[d]
- }
- } else this._currentFrame = b.frames[d | 0];
- else if (e = this.spriteSheet.getNumFrames(), c >= e && !this._dispatchAnimationEnd(b, c, a, e - 1) && (this._currentFrame -= e) >= e) return this._normalizeFrame();
- this.currentFrame = this._currentFrame | 0
- };
- a._dispatchAnimationEnd = function (b, a, c, d, e) {
- var h = b ? b.name : null;
- if (this.hasEventListener("animationend")) {
- var k = new createjs.Event("animationend");
- k.name = h;
- k.next = d;
- this.dispatchEvent(k)
- }
- b = this._animation != b || this._currentFrame != a;
- b || c || !this.paused || (this.currentAnimationFrame = e, b = !0);
- return b
- };
- a.DisplayObject_cloneProps = a.cloneProps;
- a.cloneProps = function (b) {
- this.DisplayObject_cloneProps(b);
- b.currentFrame = this.currentFrame;
- b._currentFrame = this._currentFrame;
- b.currentAnimation = this.currentAnimation;
- b.paused = this.paused;
- b._animation = this._animation;
- b.currentAnimationFrame = this.currentAnimationFrame;
- b.framerate = this.framerate
- };
- a._goto = function (b, a) {
- if (isNaN(b)) {
- var c = this.spriteSheet.getAnimation(b);
- c && (this.currentAnimationFrame = a || 0, this._animation = c, this.currentAnimation = b, this._normalizeFrame())
- } else this.currentAnimationFrame = 0, this.currentAnimation = this._animation = null, this._currentFrame = b, this._normalizeFrame()
- };
- createjs.Sprite = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- if (!createjs.Sprite) throw "BitmapAnimation is deprecated in favour of Sprite. See VERSIONS file for info on changes.";
- (createjs.BitmapAnimation = function (c) {
- console.log("BitmapAnimation is deprecated in favour of Sprite. See VERSIONS file for info on changes.");
- this.initialize(c)
- })
- .prototype = new createjs.Sprite
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b) {
- this.initialize(b)
- },
- a = c.prototype = new createjs.DisplayObject;
- a.graphics = null;
- a.DisplayObject_initialize = a.initialize;
- a.initialize = function (b) {
- this.DisplayObject_initialize();
- this.graphics = b ? b : new createjs.Graphics
- };
- a.isVisible = function () {
- var b = this.cacheCanvas || this.graphics && !this.graphics.isEmpty();
- return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY && b)
- };
- a.DisplayObject_draw = a.draw;
- a.draw = function (b, a) {
- if (this.DisplayObject_draw(b, a)) return !0;
- this.graphics.draw(b);
- return !0
- };
- a.clone = function (b) {
- b = new c(b && this.graphics ? this.graphics.clone() : this.graphics);
- this.cloneProps(b);
- return b
- };
- a.toString = function () {
- return "[Shape (name=" + this.name + ")]"
- };
- createjs.Shape = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, a, c) {
- this.initialize(b, a, c)
- },
- a = c.prototype = new createjs.DisplayObject,
- b = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
- b.getContext && (c._workingContext = b.getContext("2d"), b.width = b.height = 1);
- c.H_OFFSETS = {
- start: 0,
- left: 0,
- center: -0.5,
- end: -1,
- right: -1
- };
- c.V_OFFSETS = {
- top: 0,
- hanging: -0.01,
- middle: -0.4,
- alphabetic: -0.8,
- ideographic: -0.85,
- bottom: -1
- };
- a.text = "";
- a.font = null;
- a.color = null;
- a.textAlign = "left";
- a.textBaseline = "top";
- a.maxWidth = null;
- a.outline = 0;
- a.lineHeight = 0;
- a.lineWidth = null;
- a.DisplayObject_initialize = a.initialize;
- a.initialize = function (b, a, c) {
- this.DisplayObject_initialize();
- this.text = b;
- this.font = a;
- this.color = c
- };
- a.isVisible = function () {
- var b = this.cacheCanvas || null != this.text && "" !== this.text;
- return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY && b)
- };
- a.DisplayObject_draw = a.draw;
- a.draw = function (b, a) {
- if (this.DisplayObject_draw(b, a)) return !0;
- var c = this.color || "#000";
- this.outline ? (b.strokeStyle = c, b.lineWidth = 1 * this.outline) : b.fillStyle =
- c;
- this._drawText(this._prepContext(b));
- return !0
- };
- a.getMeasuredWidth = function () {
- return this._prepContext(c._workingContext)
- .measureText(this.text)
- .width
- };
- a.getMeasuredLineHeight = function () {
- return 1.2 * this._prepContext(c._workingContext)
- .measureText("M")
- .width
- };
- a.getMeasuredHeight = function () {
- return this._drawText(null, {})
- .height
- };
- a.DisplayObject_getBounds = a.getBounds;
- a.getBounds = function () {
- var b = this.DisplayObject_getBounds();
- if (b) return b;
- if (null == this.text || "" == this.text) return null;
- var b = this._drawText(null, {}),
- a = this.maxWidth && this.maxWidth < b.width ? this.maxWidth : b.width,
- d = a * c.H_OFFSETS[this.textAlign || "left"],
- e = (this.lineHeight || this.getMeasuredLineHeight()) * c.V_OFFSETS[this.textBaseline || "top"];
- return this._rectangle.initialize(d, e, a, b.height)
- };
- a.clone = function () {
- var b = new c(this.text, this.font, this.color);
- this.cloneProps(b);
- return b
- };
- a.toString = function () {
- return "[Text (text=" + (20 < this.text.length ? this.text.substr(0, 17) + "..." : this.text) + ")]"
- };
- a.DisplayObject_cloneProps = a.cloneProps;
- a.cloneProps = function (b) {
- this.DisplayObject_cloneProps(b);
- b.textAlign = this.textAlign;
- b.textBaseline = this.textBaseline;
- b.maxWidth = this.maxWidth;
- b.outline = this.outline;
- b.lineHeight = this.lineHeight;
- b.lineWidth = this.lineWidth
- };
- a._prepContext = function (b) {
- b.font = this.font;
- b.textAlign = this.textAlign || "left";
- b.textBaseline = this.textBaseline || "top";
- return b
- };
- a._drawText = function (b, a) {
- var d = !!b;
- d || (b = this._prepContext(c._workingContext));
- for (var e = this.lineHeight || this.getMeasuredLineHeight(), h = 0, k = 0, m = String(this.text)
- .split(/(?:\r\n|\r|\n)/), n = 0, p = m.length; n < p; n++) {
- var r =
- m[n],
- s = null;
- if (null != this.lineWidth && (s = b.measureText(r)
- .width) > this.lineWidth)
- for (var t = r.split(/(\s)/), r = t[0], s = b.measureText(r)
- .width, q = 1, w = t.length; q < w; q += 2) {
- var u = b.measureText(t[q] + t[q + 1])
- .width;
- s + u > this.lineWidth ? (d && this._drawTextLine(b, r, k * e), s > h && (h = s), r = t[q + 1], s = b.measureText(r)
- .width, k++) : (r += t[q] + t[q + 1], s += u)
- }
- d && this._drawTextLine(b, r, k * e);
- a && null == s && (s = b.measureText(r)
- .width);
- s > h && (h = s);
- k++
- }
- a && (a.count = k, a.width = h, a.height = k * e);
- return a
- };
- a._drawTextLine = function (b, a, c) {
- this.outline ?
- b.strokeText(a, 0, c, this.maxWidth || 65535) : b.fillText(a, 0, c, this.maxWidth || 65535)
- };
- createjs.Text = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- function c(b, a) {
- this.initialize(b, a)
- }
- var a = c.prototype = new createjs.DisplayObject;
- a.text = "";
- a.spriteSheet = null;
- a.lineHeight = 0;
- a.letterSpacing = 0;
- a.isNeedCenter = !1;
- a.centerX = 0;
- a.centerY = 0;
- a.textBounds;
- a.spaceWidth = 0;
- a.postfix = "";
- a.DisplayObject_initialize = a.initialize;
- a.initialize = function (b, c) {
- this.DisplayObject_initialize();
- this.text = b;
- this.spriteSheet = c;
- a.textBounds = new createjs.Rectangle
- };
- a.DisplayObject_draw = a.draw;
- a.draw = function (b, a) {
- if (this.DisplayObject_draw(b, a)) return !0;
- this._drawText(b)
- };
- a.isVisible = function () {
- var b = this.cacheCanvas || this.spriteSheet && this.spriteSheet.complete && this.text;
- return !!(this.visible && 0 < this.alpha && 0 != this.scaleX && 0 != this.scaleY && b)
- };
- a.getBounds = function () {
- var b = this._rectangle;
- this._drawText(null, b);
- return b.width ? b : null
- };
- a._getFrame = function (b, a) {
- var c, d = a.getAnimation(b + this.postfix);
- d || (b != (c = b.toUpperCase()) || b != (c = b.toLowerCase()) || (c = null), c && (d = a.getAnimation(c + this.postfix)));
- return d && a.getFrame(d.frames[0])
- };
- a._getLineHeight = function (b) {
- return (b =
- this._getFrame("1", b) || this._getFrame("T", b) || this._getFrame("L", b) || b.getFrame(0)) ? b.rect.height : 1
- };
- a._getSpaceWidth = function (b) {
- return (b = this._getFrame("1", b) || this._getFrame("l", b) || this._getFrame("e", b) || this._getFrame("a", b) || b.getFrame(0)) ? b.rect.width : 1
- };
- a._drawText = function (b, a) {
- var c, d, e, h = 0,
- k = 0,
- m = this.spaceWidth,
- n = this.lineHeight,
- p = this.spriteSheet;
- 0 == m && (m = this._getSpaceWidth(p));
- 0 == n && (n = this._getLineHeight(p));
- for (var r = 0, s = 0, t = this.text.length; s < t; s++)
- if (c = this.text.charAt(s), " " == c) h +=
- m;
- else if ("\n" == c || "\r" == c) "\r" == c && "\n" == this.text.charAt(s + 1) && s++, h - e > r && (r = h - e), h = 0, k += n;
- else {
- var q = this._getFrame(c, p);
- if (q) {
- var w = q.rect;
- e = q.regX;
- c = w.width;
- b && b.drawImage(q.image, w.x, w.y, c, d = w.height, h - e, k - q.regY, c, d);
- h += c + this.letterSpacing
- }
- }
- h - e > r && (r = h - e);
- a && (a.width = r - this.letterSpacing, a.height = k + n);
- this.textBounds.width = r - this.letterSpacing;
- this.textBounds.height = k + n
- };
- createjs.BitmapText = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function () {
- throw "SpriteSheetUtils cannot be instantiated";
- },
- a = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
- a.getContext && (c._workingCanvas = a, c._workingContext = a.getContext("2d"), a.width = a.height = 1);
- c.addFlippedFrames = function (b, a, f, d) {
- if (a || f || d) {
- var e = 0;
- a && c._flip(b, ++e, !0, !1);
- f && c._flip(b, ++e, !1, !0);
- d && c._flip(b, ++e, !0, !0)
- }
- };
- c.extractFrame = function (b, a) {
- isNaN(a) && (a = b.getAnimation(a)
- .frames[0]);
- var f = b.getFrame(a);
- if (!f) return null;
- var d = f.rect,
- e = c._workingCanvas;
- e.width = d.width;
- e.height = d.height;
- c._workingContext.drawImage(f.image, d.x, d.y, d.width, d.height, 0, 0, d.width, d.height);
- f = document.createElement("img");
- f.src = e.toDataURL("image/png");
- return f
- };
- c.mergeAlpha = function (b, a, c) {
- c || (c = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"));
- c.width = Math.max(a.width, b.width);
- c.height = Math.max(a.height, b.height);
- var d = c.getContext("2d");
- d.save();
- d.drawImage(b, 0, 0);
- d.globalCompositeOperation = "destination-in";
- d.drawImage(a,
- 0, 0);
- d.restore();
- return c
- };
- c._flip = function (b, a, f, d) {
- for (var e = b._images, h = c._workingCanvas, k = c._workingContext, m = e.length / a, n = 0; n < m; n++) {
- var p = e[n];
- p.__tmp = n;
- k.setTransform(1, 0, 0, 1, 0, 0);
- k.clearRect(0, 0, h.width + 1, h.height + 1);
- h.width = p.width;
- h.height = p.height;
- k.setTransform(f ? -1 : 1, 0, 0, d ? -1 : 1, f ? p.width : 0, d ? p.height : 0);
- k.drawImage(p, 0, 0);
- var r = document.createElement("img");
- r.src = h.toDataURL("image/png");
- r.width = p.width;
- r.height = p.height;
- e.push(r)
- }
- k = b._frames;
- h = k.length / a;
- for (n = 0; n < h; n++) {
- var p = k[n],
- s = p.rect.clone(),
- r = e[p.image.__tmp + m * a],
- t = {
- image: r,
- rect: s,
- regX: p.regX,
- regY: p.regY
- };
- f && (s.x = r.width - s.x - s.width, t.regX = s.width - p.regX);
- d && (s.y = r.height - s.y - s.height, t.regY = s.height - p.regY);
- k.push(t)
- }
- f = "_" + (f ? "h" : "") + (d ? "v" : "");
- d = b._animations;
- b = b._data;
- e = d.length / a;
- for (n = 0; n < e; n++) {
- k = d[n];
- p = b[k];
- m = {
- name: k + f,
- frequency: p.frequency,
- next: p.next,
- frames: []
- };
- p.next && (m.next += f);
- k = p.frames;
- p = 0;
- for (r = k.length; p < r; p++) m.frames.push(k[p] + h * a);
- b[m.name] = m;
- d.push(m.name)
- }
- };
- createjs.SpriteSheetUtils = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function () {
- this.initialize()
- },
- a = c.prototype = new createjs.EventDispatcher;
- c.ERR_DIMENSIONS = "frame dimensions exceed max spritesheet dimensions";
- c.ERR_RUNNING = "a build is already running";
- a.maxWidth = 2048;
- a.maxHeight = 2048;
- a.spriteSheet = null;
- a.scale = 1;
- a.padding = 1;
- a.timeSlice = 0.3;
- a.progress = -1;
- a._frames = null;
- a._animations = null;
- a._data = null;
- a._nextFrameIndex = 0;
- a._index = 0;
- a._timerID = null;
- a._scale = 1;
- a.initialize = function () {
- this._frames = [];
- this._animations = {}
- };
- a.addFrame = function (b, a, f, d,
- e, h) {
- if (this._data) throw c.ERR_RUNNING;
- a = a || b.bounds || b.nominalBounds;
- !a && b.getBounds && (a = b.getBounds());
- if (!a) return null;
- f = f || 1;
- return this._frames.push({
- source: b,
- sourceRect: a,
- scale: f,
- funct: d,
- params: e,
- scope: h,
- index: this._frames.length,
- height: a.height * f
- }) - 1
- };
- a.addAnimation = function (b, a, f, d) {
- if (this._data) throw c.ERR_RUNNING;
- this._animations[b] = {
- frames: a,
- next: f,
- frequency: d
- }
- };
- a.addMovieClip = function (b, a, f) {
- if (this._data) throw c.ERR_RUNNING;
- var d = b.frameBounds,
- e = a || b.bounds || b.nominalBounds;
- !e && b.getBounds &&
- (e = b.getBounds());
- if (!e && !d) return null;
- a = this._frames.length;
- for (var h = b.timeline.duration, k = 0; k < h; k++) this.addFrame(b, d && d[k] ? d[k] : e, f, function (b) {
- var a = this.actionsEnabled;
- this.actionsEnabled = !1;
- this.gotoAndStop(b);
- this.actionsEnabled = a
- }, [k], b);
- k = b.timeline._labels;
- b = [];
- for (var m in k) b.push({
- index: k[m],
- label: m
- });
- if (b.length)
- for (b.sort(function (b, a) {
- return b.index - a.index
- }), k = 0, m = b.length; k < m; k++) {
- f = b[k].label;
- for (var d = a + (k == m - 1 ? h : b[k + 1].index), e = [], n = a + b[k].index; n < d; n++) e.push(n);
- this.addAnimation(f,
- e, !0)
- }
- };
- a.build = function () {
- if (this._data) throw c.ERR_RUNNING;
- for (this._startBuild(); this._drawNext(););
- this._endBuild();
- return this.spriteSheet
- };
- a.buildAsync = function (b) {
- if (this._data) throw c.ERR_RUNNING;
- this.timeSlice = b;
- this._startBuild();
- var a = this;
- this._timerID = setTimeout(function () {
- a._run()
- }, 50 - 50 * Math.max(0.01, Math.min(0.99, this.timeSlice || 0.3)))
- };
- a.stopAsync = function () {
- clearTimeout(this._timerID);
- this._data = null
- };
- a.clone = function () {
- throw "SpriteSheetBuilder cannot be cloned.";
- };
- a.toString = function () {
- return "[SpriteSheetBuilder]"
- };
- a._startBuild = function () {
- var b = this.padding || 0;
- this.progress = 0;
- this.spriteSheet = null;
- this._index = 0;
- this._scale = this.scale;
- var a = [];
- this._data = {
- images: [],
- frames: a,
- animations: this._animations
- };
- var f = this._frames.slice();
- f.sort(function (b, a) {
- return b.height <= a.height ? -1 : 1
- });
- if (f[f.length - 1].height + 2 * b > this.maxHeight) throw c.ERR_DIMENSIONS;
- for (var d = 0, e = 0, h = 0; f.length;) {
- var k = this._fillRow(f, d, h, a, b);
- k.w > e && (e = k.w);
- d += k.h;
- if (!k.h || !f.length) {
- var m = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
- m.width = this._getSize(e, this.maxWidth);
- m.height = this._getSize(d, this.maxHeight);
- this._data.images[h] = m;
- k.h || (e = d = 0, h++)
- }
- }
- };
- a._getSize = function (b, a) {
- for (var c = 4; Math.pow(2, ++c) < b;);
- return Math.min(a, Math.pow(2, c))
- };
- a._fillRow = function (b, a, f, d, e) {
- var h = this.maxWidth,
- k = this.maxHeight;
- a += e;
- for (var k = k - a, m = e, n = 0, p = b.length - 1; 0 <= p; p--) {
- var r = b[p],
- s = this._scale * r.scale,
- t = r.sourceRect,
- q = r.source,
- w = Math.floor(s * t.x - e),
- u = Math.floor(s * t.y - e),
- x = Math.ceil(s * t.height + 2 * e),
- t = Math.ceil(s * t.width + 2 * e);
- if (t > h) throw c.ERR_DIMENSIONS;
- x > k || m + t > h || (r.img = f, r.rect = new createjs.Rectangle(m, a, t, x), n = n || x, b.splice(p, 1), d[r.index] = [m, a, t, x, f, Math.round(-w + s * q.regX - e), Math.round(-u + s * q.regY - e)], m += t)
- }
- return {
- w: m,
- h: n
- }
- };
- a._endBuild = function () {
- this.spriteSheet = new createjs.SpriteSheet(this._data);
- this._data = null;
- this.progress = 1;
- this.dispatchEvent("complete")
- };
- a._run = function () {
- for (var b = 50 * Math.max(0.01, Math.min(0.99, this.timeSlice || 0.3)), a = (new Date)
- .getTime() + b, c = !1; a > (new Date)
- .getTime();)
- if (!this._drawNext()) {
- c = !0;
- break
- }
- if (c) this._endBuild();
- else {
- var d = this;
- this._timerID = setTimeout(function () {
- d._run()
- }, 50 - b)
- }
- b = this.progress = this._index / this._frames.length;
- this.hasEventListener("progress") && (a = new createjs.Event("progress"), a.progress = b, this.dispatchEvent(a))
- };
- a._drawNext = function () {
- var b = this._frames[this._index],
- a = b.scale * this._scale,
- c = b.rect,
- d = b.sourceRect,
- e = this._data.images[b.img].getContext("2d");
- b.funct && b.funct.apply(b.scope, b.params);
- e.save();
- e.beginPath();
- e.rect(c.x, c.y, c.width, c.height);
- e.clip();
- e.translate(Math.ceil(c.x - d.x *
- a), Math.ceil(c.y - d.y * a));
- e.scale(a, a);
- b.source.draw(e);
- e.restore();
- return ++this._index < this._frames.length
- };
- createjs.SpriteSheetBuilder = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b) {
- this.initialize(b)
- },
- a = c.prototype = new createjs.DisplayObject;
- a.htmlElement = null;
- a._oldMtx = null;
- a._visible = !1;
- a.DisplayObject_initialize = a.initialize;
- a.initialize = function (b) {
- "string" == typeof b && (b = document.getElementById(b));
- this.DisplayObject_initialize();
- this.mouseEnabled = !1;
- this.htmlElement = b;
- b = b.style;
- b.position = "absolute";
- b.transformOrigin = b.WebkitTransformOrigin = b.msTransformOrigin = b.MozTransformOrigin = b.OTransformOrigin = "0% 0%"
- };
- a.isVisible = function () {
- return null !=
- this.htmlElement
- };
- a.draw = function (b, a) {
- this.visible && (this._visible = !0);
- return !0
- };
- a.cache = function () {};
- a.uncache = function () {};
- a.updateCache = function () {};
- a.hitTest = function () {};
- a.localToGlobal = function () {};
- a.globalToLocal = function () {};
- a.localToLocal = function () {};
- a.clone = function () {
- throw "DOMElement cannot be cloned.";
- };
- a.toString = function () {
- return "[DOMElement (name=" + this.name + ")]"
- };
- a.DisplayObject__tick = a._tick;
- a._tick = function (b) {
- var a = this.getStage();
- this._visible = !1;
- a && a.on("drawend", this._handleDrawEnd,
- this, !0);
- this.DisplayObject__tick(b)
- };
- a._handleDrawEnd = function (b) {
- if (b = this.htmlElement) {
- b = b.style;
- var a = this._visible ? "visible" : "hidden";
- a != b.visibility && (b.visibility = a);
- if (this._visible) {
- var a = this.getConcatenatedMatrix(this._matrix),
- c = this._oldMtx;
- c && c.alpha == a.alpha || (b.opacity = "" + (1E4 * a.alpha | 0) / 1E4, c && (c.alpha = a.alpha));
- if (!c || c.tx != a.tx || c.ty != a.ty || c.a != a.a || c.b != a.b || c.c != a.c || c.d != a.d) {
- var d = "matrix(" + (1E4 * a.a | 0) / 1E4 + "," + (1E4 * a.b | 0) / 1E4 + "," + (1E4 * a.c | 0) / 1E4 + "," + (1E4 * a.d | 0) / 1E4 + "," + (a.tx +
- 0.5 | 0);
- b.transform = b.WebkitTransform = b.OTransform = b.msTransform = d + "," + (a.ty + 0.5 | 0) + ")";
- b.MozTransform = d + "px," + (a.ty + 0.5 | 0) + "px)";
- this._oldMtx = c ? c.copy(a) : a.clone()
- }
- }
- }
- };
- createjs.DOMElement = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function () {
- this.initialize()
- },
- a = c.prototype;
- a.initialize = function () {};
- a.getBounds = function () {
- return null
- };
- a.applyFilter = function (b, a, c, d, e, h, k, m) {};
- a.toString = function () {
- return "[Filter]"
- };
- a.clone = function () {
- return new c
- };
- createjs.Filter = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, a, c) {
- this.initialize(b, a, c)
- },
- a = c.prototype = new createjs.Filter;
- a.initialize = function (b, a, c) {
- if (isNaN(b) || 0 > b) b = 0;
- this.blurX = b | 0;
- if (isNaN(a) || 0 > a) a = 0;
- this.blurY = a | 0;
- if (isNaN(c) || 1 > c) c = 1;
- this.quality = c | 0
- };
- a.blurX = 0;
- a.blurY = 0;
- a.quality = 1;
- a.mul_table = [1, 171, 205, 293, 57, 373, 79, 137, 241, 27, 391, 357, 41, 19, 283, 265, 497, 469, 443, 421, 25, 191, 365, 349, 335, 161, 155, 149, 9, 278, 269, 261, 505, 245, 475, 231, 449, 437, 213, 415, 405, 395, 193, 377, 369, 361, 353, 345, 169, 331, 325, 319, 313, 307, 301, 37, 145, 285, 281,
- 69, 271, 267, 263, 259, 509, 501, 493, 243, 479, 118, 465, 459, 113, 446, 55, 435, 429, 423, 209, 413, 51, 403, 199, 393, 97, 3, 379, 375, 371, 367, 363, 359, 355, 351, 347, 43, 85, 337, 333, 165, 327, 323, 5, 317, 157, 311, 77, 305, 303, 75, 297, 294, 73, 289, 287, 71, 141, 279, 277, 275, 68, 135, 67, 133, 33, 262, 260, 129, 511, 507, 503, 499, 495, 491, 61, 121, 481, 477, 237, 235, 467, 232, 115, 457, 227, 451, 7, 445, 221, 439, 218, 433, 215, 427, 425, 211, 419, 417, 207, 411, 409, 203, 202, 401, 399, 396, 197, 49, 389, 387, 385, 383, 95, 189, 47, 187, 93, 185, 23, 183, 91, 181, 45, 179, 89, 177, 11, 175, 87, 173, 345, 343,
- 341, 339, 337, 21, 167, 83, 331, 329, 327, 163, 81, 323, 321, 319, 159, 79, 315, 313, 39, 155, 309, 307, 153, 305, 303, 151, 75, 299, 149, 37, 295, 147, 73, 291, 145, 289, 287, 143, 285, 71, 141, 281, 35, 279, 139, 69, 275, 137, 273, 17, 271, 135, 269, 267, 133, 265, 33, 263, 131, 261, 130, 259, 129, 257, 1
- ];
- a.shg_table = [0, 9, 10, 11, 9, 12, 10, 11, 12, 9, 13, 13, 10, 9, 13, 13, 14, 14, 14, 14, 10, 13, 14, 14, 14, 13, 13, 13, 9, 14, 14, 14, 15, 14, 15, 14, 15, 15, 14, 15, 15, 15, 14, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 12, 14, 15, 15, 13, 15, 15, 15, 15, 16, 16, 16, 15, 16, 14, 16, 16, 14, 16, 13, 16, 16, 16, 15, 16, 13, 16, 15,
- 16, 14, 9, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 14, 16, 16, 15, 16, 16, 10, 16, 15, 16, 14, 16, 16, 14, 16, 16, 14, 16, 16, 14, 15, 16, 16, 16, 14, 15, 14, 15, 13, 16, 16, 15, 17, 17, 17, 17, 17, 17, 14, 15, 17, 17, 16, 16, 17, 16, 15, 17, 16, 17, 11, 17, 16, 17, 16, 17, 16, 17, 17, 16, 17, 17, 16, 17, 17, 16, 16, 17, 17, 17, 16, 14, 17, 17, 17, 17, 15, 16, 14, 16, 15, 16, 13, 16, 15, 16, 14, 16, 15, 16, 12, 16, 15, 16, 17, 17, 17, 17, 17, 13, 16, 15, 17, 17, 17, 16, 15, 17, 17, 17, 16, 15, 17, 17, 14, 16, 17, 17, 16, 17, 17, 16, 15, 17, 16, 14, 17, 16, 15, 17, 16, 17, 17, 16, 17, 15, 16, 17, 14, 17, 16, 15, 17, 16, 17, 13, 17, 16, 17, 17, 16, 17, 14, 17, 16,
- 17, 16, 17, 16, 17, 9
- ];
- a.getBounds = function () {
- var b = 0.5 * Math.pow(this.quality, 0.6);
- return new createjs.Rectangle(-this.blurX * b, -this.blurY * b, 2 * this.blurX * b, 2 * this.blurY * b)
- };
- a.applyFilter = function (b, a, c, d, e, h, k, m) {
- h = h || b;
- null == k && (k = a);
- null == m && (m = c);
- try {
- var n = b.getImageData(a, c, d, e)
- } catch (p) {
- return !1
- }
- b = this.blurX / 2;
- if (isNaN(b) || 0 > b) return !1;
- b |= 0;
- var r = this.blurY / 2;
- if (isNaN(r) || 0 > r) return !1;
- r |= 0;
- if (0 == b && 0 == r) return !1;
- var s = this.quality;
- if (isNaN(s) || 1 > s) s = 1;
- s |= 0;
- 3 < s && (s = 3);
- 1 > s && (s = 1);
- var t = n.data,
- q, w, u,
- x, K, A, y, C, z, F, J, P, E = b + b + 1;
- x = r + r + 1;
- var S = d - 1,
- N = e - 1,
- Z = b + 1,
- T = r + 1,
- Q = {
- r: 0,
- b: 0,
- g: 0,
- a: 0,
- next: null
- };
- a = Q;
- for (q = 1; q < E; q++) a = a.next = {
- r: 0,
- b: 0,
- g: 0,
- a: 0,
- next: null
- };
- a.next = Q;
- c = E = {
- r: 0,
- b: 0,
- g: 0,
- a: 0,
- next: null
- };
- for (q = 1; q < x; q++) c = c.next = {
- r: 0,
- b: 0,
- g: 0,
- a: 0,
- next: null
- };
- c.next = E;
- for (q = null; 0 < s--;) {
- K = x = 0;
- var G = this.mul_table[b],
- M = this.shg_table[b];
- for (c = e; - 1 < --c;) {
- A = Z * (F = t[x]);
- y = Z * (J = t[x + 1]);
- C = Z * (P = t[x + 2]);
- z = Z * (u = t[x + 3]);
- a = Q;
- for (q = Z; - 1 < --q;) a.r = F, a.g = J, a.b = P, a.a = u, a = a.next;
- for (q = 1; q < Z; q++) w = x + ((S < q ? S : q) << 2), A += a.r = t[w], y += a.g =
- t[w + 1], C += a.b = t[w + 2], z += a.a = t[w + 3], a = a.next;
- q = Q;
- for (a = 0; a < d; a++) t[x++] = A * G >>> M, t[x++] = y * G >>> M, t[x++] = C * G >>> M, t[x++] = z * G >>> M, w = K + ((w = a + b + 1) < S ? w : S) << 2, A -= q.r - (q.r = t[w]), y -= q.g - (q.g = t[w + 1]), C -= q.b - (q.b = t[w + 2]), z -= q.a - (q.a = t[w + 3]), q = q.next;
- K += d
- }
- G = this.mul_table[r];
- M = this.shg_table[r];
- for (a = 0; a < d; a++) {
- x = a << 2;
- A = T * (F = t[x]);
- y = T * (J = t[x + 1]);
- C = T * (P = t[x + 2]);
- z = T * (u = t[x + 3]);
- c = E;
- for (q = 0; q < T; q++) c.r = F, c.g = J, c.b = P, c.a = u, c = c.next;
- u = d;
- for (q = 1; q <= r; q++) x = u + a << 2, A += c.r = t[x], y += c.g = t[x + 1], C += c.b = t[x + 2], z += c.a = t[x + 3], c =
- c.next, q < N && (u += d);
- x = a;
- q = E;
- if (0 < s)
- for (c = 0; c < e; c++) w = x << 2, t[w + 3] = u = z * G >>> M, 0 < u ? (t[w] = A * G >>> M, t[w + 1] = y * G >>> M, t[w + 2] = C * G >>> M) : t[w] = t[w + 1] = t[w + 2] = 0, w = a + ((w = c + T) < N ? w : N) * d << 2, A -= q.r - (q.r = t[w]), y -= q.g - (q.g = t[w + 1]), C -= q.b - (q.b = t[w + 2]), z -= q.a - (q.a = t[w + 3]), q = q.next, x += d;
- else
- for (c = 0; c < e; c++) w = x << 2, t[w + 3] = u = z * G >>> M, 0 < u ? (u = 255 / u, t[w] = (A * G >>> M) * u, t[w + 1] = (y * G >>> M) * u, t[w + 2] = (C * G >>> M) * u) : t[w] = t[w + 1] = t[w + 2] = 0, w = a + ((w = c + T) < N ? w : N) * d << 2, A -= q.r - (q.r = t[w]), y -= q.g - (q.g = t[w + 1]), C -= q.b - (q.b = t[w + 2]), z -= q.a - (q.a = t[w + 3]), q =
- q.next, x += d
- }
- }
- h.putImageData(n, k, m);
- return !0
- };
- a.clone = function () {
- return new c(this.blurX, this.blurY, this.quality)
- };
- a.toString = function () {
- return "[BlurFilter]"
- };
- createjs.BlurFilter = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b) {
- this.initialize(b)
- },
- a = c.prototype = new createjs.Filter;
- a.initialize = function (b) {
- this.alphaMap = b
- };
- a.alphaMap = null;
- a._alphaMap = null;
- a._mapData = null;
- a.applyFilter = function (b, a, c, d, e, h, k, m) {
- if (!this.alphaMap) return !0;
- if (!this._prepAlphaMap()) return !1;
- h = h || b;
- null == k && (k = a);
- null == m && (m = c);
- try {
- var n = b.getImageData(a, c, d, e)
- } catch (p) {
- return !1
- }
- b = n.data;
- a = this._mapData;
- c = b.length;
- for (d = 0; d < c; d += 4) b[d + 3] = a[d] || 0;
- n.data = b;
- h.putImageData(n, k, m);
- return !0
- };
- a.clone = function () {
- return new c(this.alphaMap)
- };
- a.toString = function () {
- return "[AlphaMapFilter]"
- };
- a._prepAlphaMap = function () {
- if (!this.alphaMap) return !1;
- if (this.alphaMap == this._alphaMap && this._mapData) return !0;
- this._mapData = null;
- var b = this._alphaMap = this.alphaMap,
- a = b;
- b instanceof HTMLCanvasElement ? a = a.getContext("2d") : (a = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"), a.width = b.width, a.height = b.height, a = a.getContext("2d"), a.drawImage(b, 0, 0));
- try {
- var c = a.getImageData(0, 0, b.width, b.height)
- } catch (d) {
- return !1
- }
- this._mapData =
- c.data;
- return !0
- };
- createjs.AlphaMapFilter = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b) {
- this.initialize(b)
- },
- a = c.prototype = new createjs.Filter;
- a.initialize = function (b) {
- this.mask = b
- };
- a.mask = null;
- a.applyFilter = function (b, a, c, d, e, h, k, m) {
- if (!this.mask) return !0;
- h = h || b;
- null == k && (k = a);
- null == m && (m = c);
- h.save();
- h.globalCompositeOperation = "destination-in";
- h.drawImage(this.mask, k, m);
- h.restore();
- return !0
- };
- a.clone = function () {
- return new c(this.mask)
- };
- a.toString = function () {
- return "[AlphaMaskFilter]"
- };
- createjs.AlphaMaskFilter = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, a, c, d, e, h, k, m) {
- this.initialize(b, a, c, d, e, h, k, m)
- },
- a = c.prototype = new createjs.Filter;
- a.redMultiplier = 1;
- a.greenMultiplier = 1;
- a.blueMultiplier = 1;
- a.alphaMultiplier = 1;
- a.redOffset = 0;
- a.greenOffset = 0;
- a.blueOffset = 0;
- a.alphaOffset = 0;
- a.initialize = function (b, a, c, d, e, h, k, m) {
- this.redMultiplier = null != b ? b : 1;
- this.greenMultiplier = null != a ? a : 1;
- this.blueMultiplier = null != c ? c : 1;
- this.alphaMultiplier = null != d ? d : 1;
- this.redOffset = e || 0;
- this.greenOffset = h || 0;
- this.blueOffset = k || 0;
- this.alphaOffset = m ||
- 0
- };
- a.applyFilter = function (b, a, c, d, e, h, k, m) {
- h = h || b;
- null == k && (k = a);
- null == m && (m = c);
- try {
- var n = b.getImageData(a, c, d, e)
- } catch (p) {
- return !1
- }
- b = n.data;
- a = b.length;
- for (c = 0; c < a; c += 4) b[c] = b[c] * this.redMultiplier + this.redOffset, b[c + 1] = b[c + 1] * this.greenMultiplier + this.greenOffset, b[c + 2] = b[c + 2] * this.blueMultiplier + this.blueOffset, b[c + 3] = b[c + 3] * this.alphaMultiplier + this.alphaOffset;
- h.putImageData(n, k, m);
- return !0
- };
- a.toString = function () {
- return "[ColorFilter]"
- };
- a.clone = function () {
- return new c(this.redMultiplier, this.greenMultiplier,
- this.blueMultiplier, this.alphaMultiplier, this.redOffset, this.greenOffset, this.blueOffset, this.alphaOffset)
- };
- createjs.ColorFilter = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, a, c, d) {
- this.initialize(b, a, c, d)
- },
- a = c.prototype = [];
- c.DELTA_INDEX = [0, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1, 0.11, 0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.2, 0.21, 0.22, 0.24, 0.25, 0.27, 0.28, 0.3, 0.32, 0.34, 0.36, 0.38, 0.4, 0.42, 0.44, 0.46, 0.48, 0.5, 0.53, 0.56, 0.59, 0.62, 0.65, 0.68, 0.71, 0.74, 0.77, 0.8, 0.83, 0.86, 0.89, 0.92, 0.95, 0.98, 1, 1.06, 1.12, 1.18, 1.24, 1.3, 1.36, 1.42, 1.48, 1.54, 1.6, 1.66, 1.72, 1.78, 1.84, 1.9, 1.96, 2, 2.12, 2.25, 2.37, 2.5, 2.62, 2.75, 2.87, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.3, 4.7, 4.9, 5, 5.5, 6, 6.5, 6.8, 7, 7.3,
- 7.5, 7.8, 8, 8.4, 8.7, 9, 9.4, 9.6, 9.8, 10
- ];
- c.IDENTITY_MATRIX = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
- c.LENGTH = c.IDENTITY_MATRIX.length;
- a.initialize = function (b, a, c, d) {
- this.reset();
- this.adjustColor(b, a, c, d);
- return this
- };
- a.reset = function () {
- return this.copyMatrix(c.IDENTITY_MATRIX)
- };
- a.adjustColor = function (b, a, c, d) {
- this.adjustHue(d);
- this.adjustContrast(a);
- this.adjustBrightness(b);
- return this.adjustSaturation(c)
- };
- a.adjustBrightness = function (b) {
- if (0 == b || isNaN(b)) return this;
- b = this._cleanValue(b, 255);
- this._multiplyMatrix([1, 0, 0, 0, b, 0, 1, 0, 0, b, 0, 0, 1, 0, b, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
- return this
- };
- a.adjustContrast = function (b) {
- if (0 == b || isNaN(b)) return this;
- b = this._cleanValue(b, 100);
- var a;
- 0 > b ? a = 127 + 127 * (b / 100) : (a = b % 1, a = 0 == a ? c.DELTA_INDEX[b] : c.DELTA_INDEX[b << 0] * (1 - a) + c.DELTA_INDEX[(b << 0) + 1] * a, a = 127 * a + 127);
- this._multiplyMatrix([a / 127, 0, 0, 0, 0.5 * (127 - a), 0, a / 127, 0, 0, 0.5 * (127 - a), 0, 0, a / 127, 0, 0.5 * (127 - a), 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
- return this
- };
- a.adjustSaturation = function (b) {
- if (0 == b || isNaN(b)) return this;
- b = this._cleanValue(b,
- 100);
- b = 1 + (0 < b ? 3 * b / 100 : b / 100);
- this._multiplyMatrix([0.3086 * (1 - b) + b, 0.6094 * (1 - b), 0.082 * (1 - b), 0, 0, 0.3086 * (1 - b), 0.6094 * (1 - b) + b, 0.082 * (1 - b), 0, 0, 0.3086 * (1 - b), 0.6094 * (1 - b), 0.082 * (1 - b) + b, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
- return this
- };
- a.adjustHue = function (b) {
- if (0 == b || isNaN(b)) return this;
- b = this._cleanValue(b, 180) / 180 * Math.PI;
- var a = Math.cos(b);
- b = Math.sin(b);
- this._multiplyMatrix([0.213 + 0.787 * a + -0.213 * b, 0.715 + -0.715 * a + -0.715 * b, 0.072 + -0.072 * a + 0.928 * b, 0, 0, 0.213 + -0.213 * a + 0.143 * b, 0.715 + a * (1 - 0.715) + 0.14 * b, 0.072 + -0.072 * a +
- -0.283 * b, 0, 0, 0.213 + -0.213 * a + -0.787 * b, 0.715 + -0.715 * a + 0.715 * b, 0.072 + 0.928 * a + 0.072 * b, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1
- ]);
- return this
- };
- a.concat = function (b) {
- b = this._fixMatrix(b);
- if (b.length != c.LENGTH) return this;
- this._multiplyMatrix(b);
- return this
- };
- a.clone = function () {
- return new c(this)
- };
- a.toArray = function () {
- return this.slice(0, c.LENGTH)
- };
- a.copyMatrix = function (b) {
- for (var a = c.LENGTH, f = 0; f < a; f++) this[f] = b[f];
- return this
- };
- a._multiplyMatrix = function (b) {
- for (var a = [], c = 0; 5 > c; c++) {
- for (var d = 0; 5 > d; d++) a[d] = this[d + 5 * c];
- for (d =
- 0; 5 > d; d++) {
- for (var e = 0, h = 0; 5 > h; h++) e += b[d + 5 * h] * a[h];
- this[d + 5 * c] = e
- }
- }
- };
- a._cleanValue = function (b, a) {
- return Math.min(a, Math.max(-a, b))
- };
- a._fixMatrix = function (b) {
- b instanceof c && (b = b.slice(0));
- b.length < c.LENGTH ? b = b.slice(0, b.length)
- .concat(c.IDENTITY_MATRIX.slice(b.length, c.LENGTH)) : b.length > c.LENGTH && (b = b.slice(0, c.LENGTH));
- return b
- };
- createjs.ColorMatrix = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b) {
- this.initialize(b)
- },
- a = c.prototype = new createjs.Filter;
- a.matrix = null;
- a.initialize = function (b) {
- this.matrix = b
- };
- a.applyFilter = function (b, a, c, d, e, h, k, m) {
- h = h || b;
- null == k && (k = a);
- null == m && (m = c);
- try {
- var n = b.getImageData(a, c, d, e)
- } catch (p) {
- return !1
- }
- b = n.data;
- a = b.length;
- var r, s, t, q;
- r = this.matrix;
- c = r[0];
- d = r[1];
- e = r[2];
- for (var w = r[3], u = r[4], x = r[5], K = r[6], A = r[7], y = r[8], C = r[9], z = r[10], F = r[11], J = r[12], P = r[13], E = r[14], S = r[15], N = r[16], Z = r[17], T = r[18], Q = r[19], G = 0; G < a; G += 4) r = b[G], s = b[G + 1], t =
- b[G + 2], q = b[G + 3], b[G] = r * c + s * d + t * e + q * w + u, b[G + 1] = r * x + s * K + t * A + q * y + C, b[G + 2] = r * z + s * F + t * J + q * P + E, b[G + 3] = r * S + s * N + t * Z + q * T + Q;
- h.putImageData(n, k, m);
- return !0
- };
- a.toString = function () {
- return "[ColorMatrixFilter]"
- };
- a.clone = function () {
- return new c(this.matrix)
- };
- createjs.ColorMatrixFilter = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function () {
- throw "Touch cannot be instantiated";
- };
- c.isSupported = function () {
- return "ontouchstart" in window || window.navigator.msPointerEnabled && 0 < window.navigator.msMaxTouchPoints
- };
- c.enable = function (a, b, g) {
- if (!a || !a.canvas || !c.isSupported()) return !1;
- a.__touch = {
- pointers: {},
- multitouch: !b,
- preventDefault: !g,
- count: 0
- };
- "ontouchstart" in window ? c._IOS_enable(a) : window.navigator.msPointerEnabled && c._IE_enable(a);
- return !0
- };
- c.disable = function (a) {
- a && ("ontouchstart" in window ? c._IOS_disable(a) : window.navigator.msPointerEnabled &&
- c._IE_disable(a))
- };
- c._IOS_enable = function (a) {
- var b = a.canvas,
- g = a.__touch.f = function (b) {
- c._IOS_handleEvent(a, b)
- };
- b.addEventListener("touchstart", g, !1);
- b.addEventListener("touchmove", g, !1);
- b.addEventListener("touchend", g, !1);
- b.addEventListener("touchcancel", g, !1)
- };
- c._IOS_disable = function (a) {
- var b = a.canvas;
- b && (a = a.__touch.f, b.removeEventListener("touchstart", a, !1), b.removeEventListener("touchmove", a, !1), b.removeEventListener("touchend", a, !1), b.removeEventListener("touchcancel", a, !1))
- };
- c._IOS_handleEvent =
- function (a, b) {
- if (a) {
- a.__touch.preventDefault && b.preventDefault && b.preventDefault();
- for (var c = b.changedTouches, f = b.type, d = 0, e = c.length; d < e; d++) {
- var h = c[d],
- k = h.identifier;
- h.target == a.canvas && ("touchstart" == f ? this._handleStart(a, k, b, h.pageX, h.pageY) : "touchmove" == f ? this._handleMove(a, k, b, h.pageX, h.pageY) : "touchend" != f && "touchcancel" != f || this._handleEnd(a, k, b))
- }
- }
- };
- c._IE_enable = function (a) {
- var b = a.canvas,
- g = a.__touch.f = function (b) {
- c._IE_handleEvent(a, b)
- };
- b.addEventListener("MSPointerDown", g, !1);
- window.addEventListener("MSPointerMove",
- g, !1);
- window.addEventListener("MSPointerUp", g, !1);
- window.addEventListener("MSPointerCancel", g, !1);
- a.__touch.preventDefault && (b.style.msTouchAction = "none");
- a.__touch.activeIDs = {}
- };
- c._IE_disable = function (a) {
- var b = a.__touch.f;
- window.removeEventListener("MSPointerMove", b, !1);
- window.removeEventListener("MSPointerUp", b, !1);
- window.removeEventListener("MSPointerCancel", b, !1);
- a.canvas && a.canvas.removeEventListener("MSPointerDown", b, !1)
- };
- c._IE_handleEvent = function (a, b) {
- if (a) {
- a.__touch.preventDefault && b.preventDefault &&
- b.preventDefault();
- var c = b.type,
- f = b.pointerId,
- d = a.__touch.activeIDs;
- if ("MSPointerDown" == c) b.srcElement == a.canvas && (d[f] = !0, this._handleStart(a, f, b, b.pageX, b.pageY));
- else if (d[f])
- if ("MSPointerMove" == c) this._handleMove(a, f, b, b.pageX, b.pageY);
- else if ("MSPointerUp" == c || "MSPointerCancel" == c) delete d[f], this._handleEnd(a, f, b)
- }
- };
- c._handleStart = function (a, b, c, f, d) {
- var e = a.__touch;
- if (e.multitouch || !e.count) {
- var h = e.pointers;
- h[b] || (h[b] = !0, e.count++, a._handlePointerDown(b, c, f, d))
- }
- };
- c._handleMove = function (a,
- b, c, f, d) {
- a.__touch.pointers[b] && a._handlePointerMove(b, c, f, d)
- };
- c._handleEnd = function (a, b, c) {
- var f = a.__touch,
- d = f.pointers;
- d[b] && (f.count--, a._handlePointerUp(b, c, !0), delete d[b])
- };
- createjs.Touch = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = createjs.EaselJS = createjs.EaselJS || {};
- c.version = "NEXT";
- c.buildDate = "Sun, 06 Oct 2013 10:56:52 GMT"
- })();
- (function () {
- var c = createjs.Stage.prototype._handlePointerDown,
- a = createjs.Stage.prototype._handlePointerUp,
- b = !1; - 1 < navigator.userAgent.indexOf("Android") && (createjs.Stage.prototype._handlePointerDown = function (a, f, d, e) {
- f.touches && (b = !0, this.enableDOMEvents(!1));
- b ? f.touches && "undefined" != typeof f.touches[0].pageX && (f.screenX = f.touches[0].pageX, f.screenY = f.touches[0].pageY, c.call(this, a, f, d, e)) : (f.screenX = f.x, f.screenY = f.y, c.call(this, a, f, d, e))
- }, createjs.Stage.prototype._handlePointerUp = function (c, f,
- d) {
- f.changedTouches && (b = !0);
- b ? f.changedTouches && "undefined" != typeof f.changedTouches[0].pageX && (f.screenX = f.changedTouches[0].pageX, f.screenY = f.changedTouches[0].pageY, a.call(this, c, f, d)) : (f.screenX = f.x, f.screenY = f.y, a.call(this, c, f, d))
- })
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = createjs.PreloadJS = createjs.PreloadJS || {};
- c.version = "0.4.0";
- c.buildDate = "Wed, 25 Sep 2013 17:09:35 GMT"
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, a, c) {
- this.initialize(b, a, c)
- },
- a = c.prototype;
- a.type = null;
- a.target = null;
- a.currentTarget = null;
- a.eventPhase = 0;
- a.bubbles = !1;
- a.cancelable = !1;
- a.timeStamp = 0;
- a.defaultPrevented = !1;
- a.propagationStopped = !1;
- a.immediatePropagationStopped = !1;
- a.removed = !1;
- a.initialize = function (b, a, c) {
- this.type = b;
- this.bubbles = a;
- this.cancelable = c;
- this.timeStamp = (new Date)
- .getTime()
- };
- a.preventDefault = function () {
- this.defaultPrevented = !0
- };
- a.stopPropagation = function () {
- this.propagationStopped = !0
- };
- a.stopImmediatePropagation =
- function () {
- this.immediatePropagationStopped = this.propagationStopped = !0
- };
- a.remove = function () {
- this.removed = !0
- };
- a.clone = function () {
- return new c(this.type, this.bubbles, this.cancelable)
- };
- a.toString = function () {
- return "[Event (type=" + this.type + ")]"
- };
- createjs.Event = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function () {},
- a = c.prototype;
- c.initialize = function (b) {
- b.addEventListener = a.addEventListener;
- b.on = a.on;
- b.removeEventListener = b.off = a.removeEventListener;
- b.removeAllEventListeners = a.removeAllEventListeners;
- b.hasEventListener = a.hasEventListener;
- b.dispatchEvent = a.dispatchEvent;
- b._dispatchEvent = a._dispatchEvent
- };
- a._listeners = null;
- a._captureListeners = null;
- a.initialize = function () {};
- a.addEventListener = function (b, a, c) {
- var d;
- d = c ? this._captureListeners = this._captureListeners || {} : this._listeners =
- this._listeners || {};
- var e = d[b];
- return e && this.removeEventListener(b, a, c), e = d[b], e ? e.push(a) : d[b] = [a], a
- };
- a.on = function (b, a, c, d, e, h) {
- return a.handleEvent && (c = c || a, a = a.handleEvent), c = c || this, this.addEventListener(b, function (b) {
- a.call(c, b, e);
- d && b.remove()
- }, h)
- };
- a.removeEventListener = function (b, a, c) {
- if (c = c ? this._captureListeners : this._listeners) {
- var d = c[b];
- if (d)
- for (var e = 0, h = d.length; h > e; e++)
- if (d[e] == a) {
- 1 == h ? delete c[b] : d.splice(e, 1);
- break
- }
- }
- };
- a.off = a.removeEventListener;
- a.removeAllEventListeners = function (b) {
- b ?
- (this._listeners && delete this._listeners[b], this._captureListeners && delete this._captureListeners[b]) : this._listeners = this._captureListeners = null
- };
- a.dispatchEvent = function (b, a) {
- if ("string" == typeof b) {
- var c = this._listeners;
- if (!c || !c[b]) return !1;
- b = new createjs.Event(b)
- }
- if (b.target = a || this, b.bubbles && this.parent) {
- for (var d = this, c = [d]; d.parent;) c.push(d = d.parent);
- for (var e = c.length, d = e - 1; 0 <= d && !b.propagationStopped; d--) c[d]._dispatchEvent(b, 1 + (0 == d));
- for (d = 1; e > d && !b.propagationStopped; d++) c[d]._dispatchEvent(b,
- 3)
- } else this._dispatchEvent(b, 2);
- return b.defaultPrevented
- };
- a.hasEventListener = function (b) {
- var a = this._listeners,
- c = this._captureListeners;
- return !!(a && a[b] || c && c[b])
- };
- a.toString = function () {
- return "[EventDispatcher]"
- };
- a._dispatchEvent = function (b, a) {
- var c, d = 1 == a ? this._captureListeners : this._listeners;
- if (b && d && (d = d[b.type]) && (c = d.length)) {
- b.currentTarget = this;
- b.eventPhase = a;
- b.removed = !1;
- for (var d = d.slice(), e = 0; c > e && !b.immediatePropagationStopped; e++) {
- var h = d[e];
- h.handleEvent ? h.handleEvent(b) : h(b);
- b.removed &&
- (this.off(b.type, h, 1 == a), b.removed = !1)
- }
- }
- };
- createjs.EventDispatcher = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- createjs.indexOf = function (c, a) {
- for (var b = 0, g = c.length; g > b; b++)
- if (a === c[b]) return b;
- return -1
- }
- })();
- this.createjs = this.createjs || {};
- (function () {
- createjs.proxy = function (c, a) {
- var b = Array.prototype.slice.call(arguments, 2);
- return function () {
- return c.apply(a, Array.prototype.slice.call(arguments, 0)
- .concat(b))
- }
- }
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function () {
- this.init()
- };
- c.prototype = {};
- var a = c.prototype;
- c.FILE_PATTERN = /^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/;
- a.loaded = !1;
- a.canceled = !1;
- a.progress = 0;
- a._item = null;
- a._basePath = null;
- a.addEventListener = null;
- a.removeEventListener = null;
- a.removeAllEventListeners = null;
- a.dispatchEvent = null;
- a.hasEventListener = null;
- a._listeners = null;
- createjs.EventDispatcher.initialize(a);
- a.getItem = function () {
- return this._item
- };
- a.init = function () {};
- a.load =
- function () {};
- a.close = function () {};
- a._sendLoadStart = function () {
- this._isCanceled() || this.dispatchEvent("loadstart")
- };
- a._sendProgress = function (b) {
- if (!this._isCanceled()) {
- var a = null;
- "number" == typeof b ? (this.progress = b, a = new createjs.Event("progress"), a.loaded = this.progress, a.total = 1) : (a = b, this.progress = b.loaded / b.total, (isNaN(this.progress) || 1 / 0 == this.progress) && (this.progress = 0));
- a.progress = this.progress;
- this.hasEventListener("progress") && this.dispatchEvent(a)
- }
- };
- a._sendComplete = function () {
- this._isCanceled() ||
- this.dispatchEvent("complete")
- };
- a._sendError = function (b) {
- !this._isCanceled() && this.hasEventListener("error") && (null == b && (b = new createjs.Event("error")), this.dispatchEvent(b))
- };
- a._isCanceled = function () {
- return null == window.createjs || this.canceled ? !0 : !1
- };
- a._parseURI = function (b) {
- return b ? b.match(c.FILE_PATTERN) : null
- };
- a._formatQueryString = function (b, a) {
- if (null == b) throw Error("You must specify data.");
- var c = [],
- d;
- for (d in b) c.push(d + "=" + escape(b[d]));
- return a && (c = c.concat(a)), c.join("&")
- };
- a.buildPath = function (b,
- a, c) {
- if (null != a) {
- var d = this._parseURI(b);
- null != d && null != d[1] && "" != d[1] || (b = a + b)
- }
- if (null == c) return b;
- a = [];
- d = b.indexOf("?");
- if (-1 != d) {
- var e = b.slice(d + 1);
- a = a.concat(e.split("&"))
- }
- return -1 != d ? b.slice(0, d) + "?" + this._formatQueryString(c, a) : b + "?" + this._formatQueryString(c, a)
- };
- a.toString = function () {
- return "[PreloadJS AbstractLoader]"
- };
- createjs.AbstractLoader = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, a) {
- this.init(b, a)
- },
- a = c.prototype = new createjs.AbstractLoader;
- c.LOAD_TIMEOUT = 8E3;
- c.BINARY = "binary";
- c.CSS = "css";
- c.IMAGE = "image";
- c.JAVASCRIPT = "javascript";
- c.JSON = "json";
- c.JSONP = "jsonp";
- c.SOUND = "sound";
- c.SVG = "svg";
- c.TEXT = "text";
- c.XML = "xml";
- c.POST = "POST";
- c.GET = "GET";
- a.useXHR = !0;
- a.stopOnError = !1;
- a.maintainScriptOrder = !0;
- a.next = null;
- a._typeCallbacks = null;
- a._extensionCallbacks = null;
- a._loadStartWasDispatched = !1;
- a._maxConnections = 1;
- a._currentlyLoadingScript = null;
- a._currentLoads =
- null;
- a._loadQueue = null;
- a._loadQueueBackup = null;
- a._loadItemsById = null;
- a._loadItemsBySrc = null;
- a._loadedResults = null;
- a._loadedRawResults = null;
- a._numItems = 0;
- a._numItemsLoaded = 0;
- a._scriptOrder = null;
- a._loadedScripts = null;
- a.init = function (b, a) {
- this._numItems = this._numItemsLoaded = 0;
- this._loadStartWasDispatched = this._paused = !1;
- this._currentLoads = [];
- this._loadQueue = [];
- this._loadQueueBackup = [];
- this._scriptOrder = [];
- this._loadedScripts = [];
- this._loadItemsById = {};
- this._loadItemsBySrc = {};
- this._loadedResults = {};
- this._loadedRawResults = {};
- this._typeCallbacks = {};
- this._extensionCallbacks = {};
- this._basePath = a;
- this.setUseXHR(b)
- };
- a.setUseXHR = function (b) {
- return this.useXHR = 0 != b && null != window.XMLHttpRequest, this.useXHR
- };
- a.removeAll = function () {
- this.remove()
- };
- a.remove = function (b) {
- var a = null;
- if (!b || b instanceof Array)
- if (b) a = b;
- else {
- if (0 < arguments.length) return
- } else a = [b];
- var c = !1;
- if (a) {
- for (; a.length;) {
- for (var e = a.pop(), h = this.getResult(e), k = this._loadQueue.length - 1; 0 <= k; k--)
- if (m = this._loadQueue[k].getItem(), m.id == e || m.src == e) {
- this._loadQueue.splice(k,
- 1)[0].cancel();
- break
- }
- for (k = this._loadQueueBackup.length - 1; 0 <= k; k--)
- if (m = this._loadQueueBackup[k].getItem(), m.id == e || m.src == e) {
- this._loadQueueBackup.splice(k, 1)[0].cancel();
- break
- }
- if (h) delete this._loadItemsById[h.id], delete this._loadItemsBySrc[h.src], this._disposeItem(h);
- else
- for (var k = this._currentLoads.length - 1; 0 <= k; k--) {
- var m = this._currentLoads[k].getItem();
- if (m.id == e || m.src == e) {
- this._currentLoads.splice(k, 1)[0].cancel();
- c = !0;
- break
- }
- }
- }
- c && this._loadNext()
- } else {
- this.close();
- for (e in this._loadItemsById) this._disposeItem(this._loadItemsById[e]);
- this.init(this.useXHR)
- }
- };
- a.reset = function () {
- this.close();
- for (var b in this._loadItemsById) this._disposeItem(this._loadItemsById[b]);
- b = [];
- i = 0;
- for (l = this._loadQueueBackup.length; l > i; i++) b.push(this._loadQueueBackup[i].getItem());
- this.loadManifest(b, !1)
- };
- c.isBinary = function (b) {
- switch (b) {
- case createjs.LoadQueue.IMAGE:
- case createjs.LoadQueue.BINARY:
- return !0;
- default:
- return !1
- }
- };
- a.installPlugin = function (b) {
- if (null != b && null != b.getPreloadHandlers) {
- b = b.getPreloadHandlers();
- if (null != b.types)
- for (var a = 0, c = b.types.length; c >
- a; a++) this._typeCallbacks[b.types[a]] = b.callback;
- if (null != b.extensions)
- for (a = 0, c = b.extensions.length; c > a; a++) this._extensionCallbacks[b.extensions[a]] = b.callback
- }
- };
- a.setMaxConnections = function (b) {
- this._maxConnections = b;
- !this._paused && 0 < this._loadQueue.length && this._loadNext()
- };
- a.loadFile = function (b, a, c) {
- if (null == b) return b = new createjs.Event("error"), b.text = "PRELOAD_NO_FILE", this._sendError(b), void 0;
- this._addItem(b, c);
- !1 !== a ? this.setPaused(!1) : this.setPaused(!0)
- };
- a.loadManifest = function (b, a, c) {
- var e =
- null;
- if (b instanceof Array) {
- if (0 == b.length) return a = new createjs.Event("error"), a.text = "PRELOAD_MANIFEST_EMPTY", this._sendError(a), void 0;
- e = b
- } else {
- if (null == b) return a = new createjs.Event("error"), a.text = "PRELOAD_MANIFEST_NULL", this._sendError(a), void 0;
- e = [b]
- }
- b = 0;
- for (var h = e.length; h > b; b++) this._addItem(e[b], c);
- !1 !== a ? this.setPaused(!1) : this.setPaused(!0)
- };
- a.load = function () {
- this.setPaused(!1)
- };
- a.getItem = function (b) {
- return this._loadItemsById[b] || this._loadItemsBySrc[b]
- };
- a.getResult = function (b, a) {
- var c =
- this._loadItemsById[b] || this._loadItemsBySrc[b];
- if (null == c) return null;
- c = c.id;
- return a && this._loadedRawResults[c] ? this._loadedRawResults[c] : this._loadedResults[c]
- };
- a.setPaused = function (b) {
- (this._paused = b) || this._loadNext()
- };
- a.close = function () {
- for (; this._currentLoads.length;) this._currentLoads.pop()
- .cancel();
- this._scriptOrder.length = 0;
- this._loadedScripts.length = 0;
- this.loadStartWasDispatched = !1
- };
- a._addItem = function (b, a) {
- var c = this._createLoadItem(b);
- if (null != c) {
- var e = this._createLoader(c, a);
- null != e &&
- (this._loadQueue.push(e), this._loadQueueBackup.push(e), this._numItems++, this._updateProgress(), this.maintainScriptOrder && c.type == createjs.LoadQueue.JAVASCRIPT && e instanceof createjs.XHRLoader && (this._scriptOrder.push(c), this._loadedScripts.push(null)))
- }
- };
- a._createLoadItem = function (b) {
- var a = null;
- switch (typeof b) {
- case "string":
- a = {
- src: b
- };
- break;
- case "object":
- a = window.HTMLAudioElement && b instanceof HTMLAudioElement ? {
- tag: b,
- src: a.tag.src,
- type: createjs.LoadQueue.SOUND
- } : b;
- break;
- default:
- return null
- }
- b = this._parseURI(a.src);
- if (null != b && (a.ext = b[5]), null == a.type && (a.type = this._getTypeByExtension(a.ext)), a.type == createjs.LoadQueue.JSON && null != a.callback && (a.type = createjs.LoadQueue.JSONP), a.type == createjs.LoadQueue.JSONP && null == a.callback) throw Error("callback is required for loading JSONP requests.");
- null == a.tag && (a.tag = this._createTag(a.type));
- null != a.id && "" != a.id || (a.id = a.src);
- if (b = this._typeCallbacks[a.type] || this._extensionCallbacks[a.ext]) {
- b = b(a.src, a.type, a.id, a.data);
- if (!1 === b) return null;
- !0 === b || (null != b.src &&
- (a.src = b.src), null != b.id && (a.id = b.id), null != b.tag && b.tag.load instanceof Function && (a.tag = b.tag), null != b.completeHandler && (a.completeHandler = b.completeHandler));
- b.type && (a.type = b.type);
- b = this._parseURI(a.src);
- null != b && null != b[5] && (a.ext = b[5].toLowerCase())
- }
- return this._loadItemsById[a.id] = a, this._loadItemsBySrc[a.src] = a, a
- };
- a._createLoader = function (b, a) {
- var c = this.useXHR;
- switch (b.type) {
- case createjs.LoadQueue.JSON:
- case createjs.LoadQueue.XML:
- case createjs.LoadQueue.TEXT:
- c = !0;
- break;
- case createjs.LoadQueue.SOUND:
- case createjs.LoadQueue.JSONP:
- c = !1;
- break;
- case null:
- return null
- }
- return null == a && (a = this._basePath), c ? new createjs.XHRLoader(b, a) : new createjs.TagLoader(b, a)
- };
- a._loadNext = function () {
- if (!this._paused) {
- this._loadStartWasDispatched || (this._sendLoadStart(), this._loadStartWasDispatched = !0);
- this._numItems == this._numItemsLoaded ? (this.loaded = !0, this._sendComplete(), this.next && this.next.load && this.next.load()) : this.loaded = !1;
- for (var b = 0; b < this._loadQueue.length && !(this._currentLoads.length >= this._maxConnections); b++) {
- var a = this._loadQueue[b];
- if (this.maintainScriptOrder && a instanceof createjs.TagLoader && a.getItem()
- .type == createjs.LoadQueue.JAVASCRIPT) {
- if (this._currentlyLoadingScript) continue;
- this._currentlyLoadingScript = !0
- }
- this._loadQueue.splice(b, 1);
- b--;
- this._loadItem(a)
- }
- }
- };
- a._loadItem = function (b) {
- b.addEventListener("progress", createjs.proxy(this._handleProgress, this));
- b.addEventListener("complete", createjs.proxy(this._handleFileComplete, this));
- b.addEventListener("error", createjs.proxy(this._handleFileError, this));
- this._currentLoads.push(b);
- this._sendFileStart(b.getItem());
- b.load()
- };
- a._handleFileError = function (b) {
- var a = b.target;
- this._numItemsLoaded++;
- this._updateProgress();
- b = new createjs.Event("error");
- b.text = "FILE_LOAD_ERROR";
- b.item = a.getItem();
- this._sendError(b);
- this.stopOnError || (this._removeLoadItem(a), this._loadNext())
- };
- a._handleFileComplete = function (b) {
- b = b.target;
- var a = b.getItem();
- if (this._loadedResults[a.id] = b.getResult(), b instanceof createjs.XHRLoader && (this._loadedRawResults[a.id] = b.getResult(!0)), this._removeLoadItem(b), this.maintainScriptOrder &&
- a.type == createjs.LoadQueue.JAVASCRIPT) {
- if (!(b instanceof createjs.TagLoader)) return this._loadedScripts[createjs.indexOf(this._scriptOrder, a)] = a, this._checkScriptLoadOrder(b), void 0;
- this._currentlyLoadingScript = !1
- }
- this._processFinishedLoad(a, b)
- };
- a._processFinishedLoad = function (b, a) {
- this._numItemsLoaded++;
- this._updateProgress();
- this._sendFileComplete(b, a);
- this._loadNext()
- };
- a._checkScriptLoadOrder = function () {
- for (var b = this._loadedScripts.length, a = 0; b > a; a++) {
- var c = this._loadedScripts[a];
- if (null === c) break;
- !0 !== c && (this._processFinishedLoad(c), this._loadedScripts[a] = !0, a--, b--)
- }
- };
- a._removeLoadItem = function (b) {
- for (var a = this._currentLoads.length, c = 0; a > c; c++)
- if (this._currentLoads[c] == b) {
- this._currentLoads.splice(c, 1);
- break
- }
- };
- a._handleProgress = function (b) {
- b = b.target;
- this._sendFileProgress(b.getItem(), b.progress);
- this._updateProgress()
- };
- a._updateProgress = function () {
- var b = this._numItemsLoaded / this._numItems,
- a = this._numItems - this._numItemsLoaded;
- if (0 < a) {
- for (var c = 0, e = 0, h = this._currentLoads.length; h > e; e++) c +=
- this._currentLoads[e].progress;
- b += c / a * (a / this._numItems)
- }
- this._sendProgress(b)
- };
- a._disposeItem = function (b) {
- delete this._loadedResults[b.id];
- delete this._loadedRawResults[b.id];
- delete this._loadItemsById[b.id];
- delete this._loadItemsBySrc[b.src]
- };
- a._createTag = function (b) {
- var a = null;
- switch (b) {
- case createjs.LoadQueue.IMAGE:
- return document.createElement("img");
- case createjs.LoadQueue.SOUND:
- return a = document.createElement("audio"), a.autoplay = !1, a;
- case createjs.LoadQueue.JSONP:
- case createjs.LoadQueue.JAVASCRIPT:
- return a =
- document.createElement("script"), a.type = "text/javascript", a;
- case createjs.LoadQueue.CSS:
- return a = this.useXHR ? document.createElement("style") : document.createElement("link"), a.rel = "stylesheet", a.type = "text/css", a;
- case createjs.LoadQueue.SVG:
- return this.useXHR ? a = document.createElement("svg") : (a = document.createElement("object"), a.type = "image/svg+xml"), a
- }
- return null
- };
- a._getTypeByExtension = function (b) {
- if (null == b) return createjs.LoadQueue.TEXT;
- switch (b.toLowerCase()) {
- case "jpeg":
- case "jpg":
- case "gif":
- case "png":
- case "webp":
- case "bmp":
- return createjs.LoadQueue.IMAGE;
- case "ogg":
- case "mp3":
- case "wav":
- return createjs.LoadQueue.SOUND;
- case "json":
- return createjs.LoadQueue.JSON;
- case "xml":
- return createjs.LoadQueue.XML;
- case "css":
- return createjs.LoadQueue.CSS;
- case "js":
- return createjs.LoadQueue.JAVASCRIPT;
- case "svg":
- return createjs.LoadQueue.SVG;
- default:
- return createjs.LoadQueue.TEXT
- }
- };
- a._sendFileProgress = function (b, a) {
- if (this._isCanceled()) return this._cleanUp(), void 0;
- if (this.hasEventListener("fileprogress")) {
- var c = new createjs.Event("fileprogress");
- c.progress = a;
- c.loaded = a;
- c.total = 1;
- c.item = b;
- this.dispatchEvent(c)
- }
- };
- a._sendFileComplete = function (b, a) {
- if (!this._isCanceled()) {
- var c = new createjs.Event("fileload");
- c.loader = a;
- c.item = b;
- c.result = this._loadedResults[b.id];
- c.rawResult = this._loadedRawResults[b.id];
- b.completeHandler && b.completeHandler(c);
- this.hasEventListener("fileload") && this.dispatchEvent(c)
- }
- };
- a._sendFileStart = function (b) {
- var a = new createjs.Event("filestart");
- a.item = b;
- this.hasEventListener("filestart") && this.dispatchEvent(a)
- };
- a.toString = function () {
- return "[PreloadJS LoadQueue]"
- };
- createjs.LoadQueue = c;
- var b = function () {};
- b.init = function () {
- var a = navigator.userAgent;
- b.isFirefox = -1 < a.indexOf("Firefox");
- b.isOpera = null != window.opera;
- b.isChrome = -1 < a.indexOf("Chrome");
- b.isIOS = -1 < a.indexOf("iPod") || -1 < a.indexOf("iPhone") || -1 < a.indexOf("iPad")
- };
- b.init();
- createjs.LoadQueue.BrowserDetect = b
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, a) {
- this.init(b, a)
- },
- a = c.prototype = new createjs.AbstractLoader;
- a._loadTimeout = null;
- a._tagCompleteProxy = null;
- a._isAudio = !1;
- a._tag = null;
- a._jsonResult = null;
- a.init = function (b, a) {
- this._item = b;
- this._basePath = a;
- this._tag = b.tag;
- this._isAudio = window.HTMLAudioElement && b.tag instanceof HTMLAudioElement;
- this._tagCompleteProxy = createjs.proxy(this._handleLoad, this)
- };
- a.getResult = function () {
- return this._item.type == createjs.LoadQueue.JSONP ? this._jsonResult : this._tag
- };
- a.cancel = function () {
- this.canceled = !0;
- this._clean();
- this.getItem()
- };
- a.load = function () {
- var b = this._item,
- a = this._tag;
- clearTimeout(this._loadTimeout);
- this._loadTimeout = setTimeout(createjs.proxy(this._handleTimeout, this), createjs.LoadQueue.LOAD_TIMEOUT);
- this._isAudio && (a.src = null, a.preload = "auto");
- a.onerror = createjs.proxy(this._handleError, this);
- this._isAudio ? (a.onstalled = createjs.proxy(this._handleStalled, this), a.addEventListener("canplaythrough", this._tagCompleteProxy, !1)) : (a.onload = createjs.proxy(this._handleLoad, this), a.onreadystatechange =
- createjs.proxy(this._handleReadyStateChange, this));
- var c = this.buildPath(b.src, this._basePath, b.values);
- switch (b.type) {
- case createjs.LoadQueue.CSS:
- a.href = c;
- break;
- case createjs.LoadQueue.SVG:
- a.data = c;
- break;
- default:
- a.src = c
- }
- if (b.type == createjs.LoadQueue.JSONP) {
- if (null == b.callback) throw Error("callback is required for loading JSONP requests.");
- if (null != window[b.callback]) throw Error('JSONP callback "' + b.callback + '" already exists on window. You need to specify a different callback. Or re-name the current one.');
- window[b.callback] = createjs.proxy(this._handleJSONPLoad, this)
- }
- b.type != createjs.LoadQueue.SVG && b.type != createjs.LoadQueue.JSONP && b.type != createjs.LoadQueue.JSON && b.type != createjs.LoadQueue.JAVASCRIPT && b.type != createjs.LoadQueue.CSS || (this._startTagVisibility = a.style.visibility, a.style.visibility = "hidden", (document.body || document.getElementsByTagName("body")[0])
- .appendChild(a));
- null != a.load && a.load()
- };
- a._handleJSONPLoad = function (b) {
- this._jsonResult = b
- };
- a._handleTimeout = function () {
- this._clean();
- var b =
- new createjs.Event("error");
- b.text = "PRELOAD_TIMEOUT";
- this._sendError(b)
- };
- a._handleStalled = function () {};
- a._handleError = function () {
- this._clean();
- var b = new createjs.Event("error");
- this._sendError(b)
- };
- a._handleReadyStateChange = function () {
- clearTimeout(this._loadTimeout);
- var b = this.getItem()
- .tag;
- "loaded" != b.readyState && "complete" != b.readyState || this._handleLoad()
- };
- a._handleLoad = function () {
- if (!this._isCanceled()) {
- var b = this.getItem(),
- a = b.tag;
- if (!(this.loaded || this.isAudio && 4 !== a.readyState)) {
- switch (this.loaded = !0, b.type) {
- case createjs.LoadQueue.SVG:
- case createjs.LoadQueue.JSONP:
- a.style.visibility = this._startTagVisibility, (document.body || document.getElementsByTagName("body")[0])
- .removeChild(a)
- }
- this._clean();
- this._sendComplete()
- }
- }
- };
- a._clean = function () {
- clearTimeout(this._loadTimeout);
- var b = this.getItem()
- .tag;
- b.onload = null;
- b.removeEventListener && b.removeEventListener("canplaythrough", this._tagCompleteProxy, !1);
- b.onstalled = null;
- b.onprogress = null;
- b.onerror = null;
- b.parentNode && b.parentNode.removeChild(b);
- b = this.getItem();
- b.type == createjs.LoadQueue.JSONP && (window[b.callback] = null)
- };
- a.toString = function () {
- return "[PreloadJS TagLoader]"
- };
- createjs.TagLoader = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, a) {
- this.init(b, a)
- },
- a = c.prototype = new createjs.AbstractLoader;
- a._request = null;
- a._loadTimeout = null;
- a._xhrLevel = 1;
- a._response = null;
- a._rawResponse = null;
- a.init = function (b, a) {
- this._item = b;
- this._basePath = a;
- !this._createXHR(b)
- };
- a.getResult = function (b) {
- return b && this._rawResponse ? this._rawResponse : this._response
- };
- a.cancel = function () {
- this.canceled = !0;
- this._clean();
- this._request.abort()
- };
- a.load = function () {
- if (null == this._request) return this._handleError(), void 0;
- this._request.onloadstart =
- createjs.proxy(this._handleLoadStart, this);
- this._request.onprogress = createjs.proxy(this._handleProgress, this);
- this._request.onabort = createjs.proxy(this._handleAbort, this);
- this._request.onerror = createjs.proxy(this._handleError, this);
- this._request.ontimeout = createjs.proxy(this._handleTimeout, this);
- 1 == this._xhrLevel && (this._loadTimeout = setTimeout(createjs.proxy(this._handleTimeout, this), createjs.LoadQueue.LOAD_TIMEOUT));
- this._request.onload = createjs.proxy(this._handleLoad, this);
- this._request.onreadystatechange =
- createjs.proxy(this._handleReadyStateChange, this);
- try {
- this._item.values && this._item.method != createjs.LoadQueue.GET ? this._item.method == createjs.LoadQueue.POST && this._request.send(this._formatQueryString(this._item.values)) : this._request.send()
- } catch (b) {
- var a = new createjs.Event("error");
- a.error = b;
- this._sendError(a)
- }
- };
- a.getAllResponseHeaders = function () {
- return this._request.getAllResponseHeaders instanceof Function ? this._request.getAllResponseHeaders() : null
- };
- a.getResponseHeader = function (b) {
- return this._request.getResponseHeader instanceof
- Function ? this._request.getResponseHeader(b) : null
- };
- a._handleProgress = function (b) {
- if (b && !(0 < b.loaded && 0 == b.total)) {
- var a = new createjs.Event("progress");
- a.loaded = b.loaded;
- a.total = b.total;
- this._sendProgress(a)
- }
- };
- a._handleLoadStart = function () {
- clearTimeout(this._loadTimeout);
- this._sendLoadStart()
- };
- a._handleAbort = function (b) {
- this._clean();
- b = new createjs.Event("error");
- b.text = "XHR_ABORTED";
- this._sendError(b)
- };
- a._handleError = function () {
- this._clean();
- var b = new createjs.Event("error");
- this._sendError(b)
- };
- a._handleReadyStateChange =
- function () {
- 4 == this._request.readyState && this._handleLoad()
- };
- a._handleLoad = function () {
- if (!this.loaded) {
- if (this.loaded = !0, !this._checkError()) return this._handleError(), void 0;
- this._response = this._getResponse();
- this._clean();
- this._generateTag() && this._sendComplete()
- }
- };
- a._handleTimeout = function (b) {
- this._clean();
- (new createjs.Event("error"))
- .text = "PRELOAD_TIMEOUT";
- this._sendError(b)
- };
- a._checkError = function () {
- switch (parseInt(this._request.status)) {
- case 404:
- case 0:
- return !1
- }
- return !0
- };
- a._getResponse = function () {
- if (null !=
- this._response) return this._response;
- if (null != this._request.response) return this._request.response;
- try {
- if (null != this._request.responseText) return this._request.responseText
- } catch (b) {}
- try {
- if (null != this._request.responseXML) return this._request.responseXML
- } catch (a) {}
- return null
- };
- a._createXHR = function (b) {
- var a = document.createElement("a");
- a.href = this.buildPath(b.src, this._basePath);
- var c = document.createElement("a");
- c.href = location.href;
- a = "" != a.hostname && (a.port != c.port || a.protocol != c.protocol || a.hostname !=
- c.hostname);
- c = null;
- if (a && window.XDomainRequest) c = new XDomainRequest;
- else if (window.XMLHttpRequest) c = new XMLHttpRequest;
- else try {
- c = new ActiveXObject("Msxml2.XMLHTTP.6.0")
- } catch (d) {
- try {
- c = new ActiveXObject("Msxml2.XMLHTTP.3.0")
- } catch (e) {
- try {
- c = new ActiveXObject("Msxml2.XMLHTTP")
- } catch (h) {
- return !1
- }
- }
- }
- b.type == createjs.LoadQueue.TEXT && c.overrideMimeType && c.overrideMimeType("text/plain; charset=x-user-defined");
- this._xhrLevel = "string" == typeof c.responseType ? 2 : 1;
- var k = null;
- return k = b.method == createjs.LoadQueue.GET ?
- this.buildPath(b.src, this._basePath, b.values) : this.buildPath(b.src, this._basePath), c.open(b.method || createjs.LoadQueue.GET, k, !0), a && c instanceof XMLHttpRequest && 1 == this._xhrLevel && c.setRequestHeader("Origin", location.origin), b.values && b.method == createjs.LoadQueue.POST && c.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), createjs.LoadQueue.isBinary(b.type) && (c.responseType = "arraybuffer"), this._request = c, !0
- };
- a._clean = function () {
- clearTimeout(this._loadTimeout);
- var b = this._request;
- b.onloadstart = null;
- b.onprogress = null;
- b.onabort = null;
- b.onerror = null;
- b.onload = null;
- b.ontimeout = null;
- b.onloadend = null;
- b.onreadystatechange = null
- };
- a._generateTag = function () {
- var b = this._item.tag;
- switch (this._item.type) {
- case createjs.LoadQueue.IMAGE:
- return b.onload = createjs.proxy(this._handleTagReady, this), b.src = this.buildPath(this._item.src, this._basePath, this._item.values), this._rawResponse = this._response, this._response = b, !1;
- case createjs.LoadQueue.JAVASCRIPT:
- return b = document.createElement("script"),
- b.text = this._response, this._rawResponse = this._response, this._response = b, !0;
- case createjs.LoadQueue.CSS:
- if (document.getElementsByTagName("head")[0].appendChild(b), b.styleSheet) b.styleSheet.cssText = this._response;
- else {
- var a = document.createTextNode(this._response);
- b.appendChild(a)
- }
- return this._rawResponse = this._response, this._response = b, !0;
- case createjs.LoadQueue.XML:
- return a = this._parseXML(this._response, "text/xml"), this._response = a, !0;
- case createjs.LoadQueue.SVG:
- return a = this._parseXML(this._response,
- "image/svg+xml"), this._rawResponse = this._response, null != a.documentElement ? (b.appendChild(a.documentElement), this._response = b) : this._response = a, !0;
- case createjs.LoadQueue.JSON:
- b = {};
- try {
- b = JSON.parse(this._response)
- } catch (c) {
- b = c
- }
- return this._rawResponse = this._response, this._response = b, !0
- }
- return !0
- };
- a._parseXML = function (b, a) {
- var c = null;
- window.DOMParser ? c = (new DOMParser)
- .parseFromString(b, a) : (c = new ActiveXObject("Microsoft.XMLDOM"), c.async = !1, c.loadXML(b));
- return c
- };
- a._handleTagReady = function () {
- this._sendComplete()
- };
- a.toString = function () {
- return "[PreloadJS XHRLoader]"
- };
- createjs.XHRLoader = c
- })();
- "object" != typeof JSON && (JSON = {});
- (function () {
- function c(b) {
- return 10 > b ? "0" + b : b
- }
- function a(b) {
- return f.lastIndex = 0, f.test(b) ? '"' + b.replace(f, function (b) {
- var a = h[b];
- return "string" == typeof a ? a : "\\u" + ("0000" + b.charCodeAt(0)
- .toString(16))
- .slice(-4)
- }) + '"' : '"' + b + '"'
- }
- function b(c, f) {
- var g, h, s, t, q, w = d,
- u = f[c];
- switch (u && "object" == typeof u && "function" == typeof u.toJSON && (u = u.toJSON(c)), "function" == typeof k && (u = k.call(f, c, u)), typeof u) {
- case "string":
- return a(u);
- case "number":
- return isFinite(u) ? String(u) : "null";
- case "boolean":
- case "null":
- return String(u);
- case "object":
- if (!u) return "null";
- if (d += e, q = [], "[object Array]" === Object.prototype.toString.apply(u)) {
- t = u.length;
- for (g = 0; t > g; g += 1) q[g] = b(g, u) || "null";
- return s = 0 === q.length ? "[]" : d ? "[\n" + d + q.join(",\n" + d) + "\n" + w + "]" : "[" + q.join(",") + "]", d = w, s
- }
- if (k && "object" == typeof k)
- for (t = k.length, g = 0; t > g; g += 1) "string" == typeof k[g] && (h = k[g], s = b(h, u), s && q.push(a(h) + (d ? ": " : ":") + s));
- else
- for (h in u) Object.prototype.hasOwnProperty.call(u, h) && (s = b(h, u), s && q.push(a(h) + (d ? ": " : ":") + s));
- return s = 0 === q.length ? "{}" : d ? "{\n" + d +
- q.join(",\n" + d) + "\n" + w + "}" : "{" + q.join(",") + "}", d = w, s
- }
- }
- "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function () {
- return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + c(this.getUTCMonth() + 1) + "-" + c(this.getUTCDate()) + "T" + c(this.getUTCHours()) + ":" + c(this.getUTCMinutes()) + ":" + c(this.getUTCSeconds()) + "Z" : null
- }, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function () {
- return this.valueOf()
- });
- var g = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- f = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- d, e, h = {
- "\b": "\\b",
- "\t": "\\t",
- "\n": "\\n",
- "\f": "\\f",
- "\r": "\\r",
- '"': '\\"',
- "\\": "\\\\"
- },
- k;
- "function" != typeof JSON.stringify && (JSON.stringify = function (a, c, f) {
- var g;
- if (d = "", e = "", "number" == typeof f)
- for (g = 0; f > g; g += 1) e += " ";
- else "string" == typeof f && (e = f); if (k = c, c && "function" != typeof c && ("object" != typeof c || "number" != typeof c.length)) throw Error("JSON.stringify");
- return b("", {
- "": a
- })
- });
- "function" != typeof JSON.parse && (JSON.parse = function (b, a) {
- function c(b, f) {
- var d, g, e = b[f];
- if (e && "object" == typeof e)
- for (d in e) Object.prototype.hasOwnProperty.call(e, d) && (g = c(e, d), void 0 !== g ? e[d] = g : delete e[d]);
- return a.call(b, f, e)
- }
- var f;
- if (b = String(b), g.lastIndex = 0, g.test(b) && (b = b.replace(g, function (b) {
- return "\\u" + ("0000" + b.charCodeAt(0)
- .toString(16))
- .slice(-4)
- })), /^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
- .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
- "]")
- .replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return f = eval("(" + b + ")"), "function" == typeof a ? c({
- "": f
- }, "") : f;
- throw new SyntaxError("JSON.parse");
- })
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, a, c) {
- this.initialize(b, a, c)
- },
- a = c.prototype;
- a.type = null;
- a.target = null;
- a.currentTarget = null;
- a.eventPhase = 0;
- a.bubbles = !1;
- a.cancelable = !1;
- a.timeStamp = 0;
- a.defaultPrevented = !1;
- a.propagationStopped = !1;
- a.immediatePropagationStopped = !1;
- a.removed = !1;
- a.initialize = function (b, a, c) {
- this.type = b;
- this.bubbles = a;
- this.cancelable = c;
- this.timeStamp = (new Date)
- .getTime()
- };
- a.preventDefault = function () {
- this.defaultPrevented = !0
- };
- a.stopPropagation = function () {
- this.propagationStopped = !0
- };
- a.stopImmediatePropagation =
- function () {
- this.immediatePropagationStopped = this.propagationStopped = !0
- };
- a.remove = function () {
- this.removed = !0
- };
- a.clone = function () {
- return new c(this.type, this.bubbles, this.cancelable)
- };
- a.toString = function () {
- return "[Event (type=" + this.type + ")]"
- };
- createjs.Event = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function () {
- this.initialize()
- },
- a = c.prototype;
- c.initialize = function (b) {
- b.addEventListener = a.addEventListener;
- b.on = a.on;
- b.removeEventListener = b.off = a.removeEventListener;
- b.removeAllEventListeners = a.removeAllEventListeners;
- b.hasEventListener = a.hasEventListener;
- b.dispatchEvent = a.dispatchEvent;
- b._dispatchEvent = a._dispatchEvent
- };
- a._listeners = null;
- a._captureListeners = null;
- a.initialize = function () {};
- a.addEventListener = function (b, a, c) {
- var d;
- d = c ? this._captureListeners = this._captureListeners || {} : this._listeners = this._listeners || {};
- var e = d[b];
- return e && this.removeEventListener(b, a, c), e = d[b], e ? e.push(a) : d[b] = [a], a
- };
- a.on = function (b, a, c, d, e, h) {
- return a.handleEvent && (c = c || a, a = a.handleEvent), c = c || this, this.addEventListener(b, function (b) {
- a.call(c, b, e);
- d && b.remove()
- }, h)
- };
- a.removeEventListener = function (b, a, c) {
- if (c = c ? this._captureListeners : this._listeners) {
- var d = c[b];
- if (d)
- for (var e = 0, h = d.length; h > e; e++)
- if (d[e] == a) {
- 1 == h ? delete c[b] : d.splice(e, 1);
- break
- }
- }
- };
- a.off = a.removeEventListener;
- a.removeAllEventListeners =
- function (b) {
- b ? (this._listeners && delete this._listeners[b], this._captureListeners && delete this._captureListeners[b]) : this._listeners = this._captureListeners = null
- };
- a.dispatchEvent = function (b, a) {
- if ("string" == typeof b) {
- var c = this._listeners;
- if (!c || !c[b]) return !1;
- b = new createjs.Event(b)
- }
- if (b.target = a || this, b.bubbles && this.parent) {
- for (var d = this, c = [d]; d.parent;) c.push(d = d.parent);
- for (var e = c.length, d = e - 1; 0 <= d && !b.propagationStopped; d--) c[d]._dispatchEvent(b, 1 + (0 == d));
- for (d = 1; e > d && !b.propagationStopped; d++) c[d]._dispatchEvent(b,
- 3)
- } else this._dispatchEvent(b, 2);
- return b.defaultPrevented
- };
- a.hasEventListener = function (b) {
- var a = this._listeners,
- c = this._captureListeners;
- return !!(a && a[b] || c && c[b])
- };
- a.toString = function () {
- return "[EventDispatcher]"
- };
- a._dispatchEvent = function (b, a) {
- var c, d = 1 == a ? this._captureListeners : this._listeners;
- if (b && d && (d = d[b.type]) && (c = d.length)) {
- b.currentTarget = this;
- b.eventPhase = a;
- b.removed = !1;
- for (var d = d.slice(), e = 0; c > e && !b.immediatePropagationStopped; e++) {
- var h = d[e];
- h.handleEvent ? h.handleEvent(b) : h(b);
- b.removed &&
- (this.off(b.type, h, 1 == a), b.removed = !1)
- }
- }
- };
- createjs.EventDispatcher = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, a, c) {
- this.initialize(b, a, c)
- },
- a = c.prototype = new createjs.EventDispatcher;
- c.NONE = 0;
- c.LOOP = 1;
- c.REVERSE = 2;
- c.IGNORE = {};
- c._tweens = [];
- c._plugins = {};
- c.get = function (b, a, f, d) {
- return d && c.removeTweens(b), new c(b, a, f)
- };
- c.tick = function (b, a) {
- for (var f = c._tweens.slice(), d = f.length - 1; 0 <= d; d--) {
- var e = f[d];
- a && !e.ignoreGlobalPause || e._paused || e.tick(e._useTicks ? 1 : b)
- }
- };
- c.handleEvent = function (b) {
- "tick" == b.type && this.tick(b.delta, b.paused)
- };
- c.removeTweens = function (b) {
- if (b.tweenjs_count) {
- for (var a =
- c._tweens, f = a.length - 1; 0 <= f; f--) a[f]._target == b && (a[f]._paused = !0, a.splice(f, 1));
- b.tweenjs_count = 0
- }
- };
- c.removeAllTweens = function () {
- for (var b = c._tweens, a = 0, f = b.length; f > a; a++) {
- var d = b[a];
- d.paused = !0;
- d.target.tweenjs_count = 0
- }
- b.length = 0
- };
- c.hasActiveTweens = function (b) {
- return b ? b.tweenjs_count : c._tweens && !!c._tweens.length
- };
- c.installPlugin = function (b, a) {
- var f = b.priority;
- null == f && (b.priority = f = 0);
- for (var d = 0, e = a.length, h = c._plugins; e > d; d++) {
- var k = a[d];
- if (h[k]) {
- for (var m = h[k], n = 0, p = m.length; p > n && !(f < m[n].priority); n++);
- h[k].splice(n, 0, b)
- } else h[k] = [b]
- }
- };
- c._register = function (b, a) {
- var f = b._target,
- d = c._tweens;
- if (a) f && (f.tweenjs_count = f.tweenjs_count ? f.tweenjs_count + 1 : 1), d.push(b), !c._inited && createjs.Ticker && (createjs.Ticker.addEventListener("tick", c), c._inited = !0);
- else
- for (f && f.tweenjs_count--, f = d.length; f--;)
- if (d[f] == b) return d.splice(f, 1), void 0
- };
- a.ignoreGlobalPause = !1;
- a.loop = !1;
- a.duration = 0;
- a.pluginData = null;
- a.target = null;
- a.position = null;
- a.passive = !1;
- a._paused = !1;
- a._curQueueProps = null;
- a._initQueueProps = null;
- a._steps =
- null;
- a._actions = null;
- a._prevPosition = 0;
- a._stepPosition = 0;
- a._prevPos = -1;
- a._target = null;
- a._useTicks = !1;
- a._inited = !1;
- a.initialize = function (b, a, f) {
- this.target = this._target = b;
- a && (this._useTicks = a.useTicks, this.ignoreGlobalPause = a.ignoreGlobalPause, this.loop = a.loop, a.onChange && this.addEventListener("change", a.onChange), a.override && c.removeTweens(b));
- this.pluginData = f || {};
- this._curQueueProps = {};
- this._initQueueProps = {};
- this._steps = [];
- this._actions = [];
- a && a.paused ? this._paused = !0 : c._register(this, !0);
- a && null !=
- a.position && this.setPosition(a.position, c.NONE)
- };
- a.wait = function (b, a) {
- if (null == b || 0 >= b) return this;
- var c = this._cloneProps(this._curQueueProps);
- return this._addStep({
- d: b,
- p0: c,
- e: this._linearEase,
- p1: c,
- v: a
- })
- };
- a.to = function (b, a, c) {
- return (isNaN(a) || 0 > a) && (a = 0), this._addStep({
- d: a || 0,
- p0: this._cloneProps(this._curQueueProps),
- e: c,
- p1: this._cloneProps(this._appendQueueProps(b))
- })
- };
- a.call = function (b, a, c) {
- return this._addAction({
- f: b,
- p: a ? a : [this],
- o: c ? c : this._target
- })
- };
- a.set = function (b, a) {
- return this._addAction({
- f: this._set,
- o: this,
- p: [b, a ? a : this._target]
- })
- };
- a.play = function (b) {
- return b || (b = this), this.call(b.setPaused, [!1], b)
- };
- a.pause = function (b) {
- return b || (b = this), this.call(b.setPaused, [!0], b)
- };
- a.setPosition = function (b, a) {
- 0 > b && (b = 0);
- null == a && (a = 1);
- var c = b,
- d = !1;
- if (c >= this.duration && (this.loop ? c %= this.duration : (c = this.duration, d = !0)), c == this._prevPos) return d;
- var e = this._prevPos;
- if (this.position = this._prevPos = c, this._prevPosition = b, this._target)
- if (d) this._updateTargetProps(null, 1);
- else if (0 < this._steps.length) {
- for (var h =
- 0, k = this._steps.length; k > h && !(this._steps[h].t > c); h++);
- h = this._steps[h - 1];
- this._updateTargetProps(h, (this._stepPosition = c - h.t) / h.d)
- }
- return 0 != a && 0 < this._actions.length && (this._useTicks ? this._runActions(c, c) : 1 == a && e > c ? (e != this.duration && this._runActions(e, this.duration), this._runActions(0, c, !0)) : this._runActions(e, c)), d && this.setPaused(!0), this.dispatchEvent("change"), d
- };
- a.tick = function (b) {
- this._paused || this.setPosition(this._prevPosition + b)
- };
- a.setPaused = function (b) {
- return this._paused = !!b, c._register(this, !b), this
- };
- a.w = a.wait;
- a.t = a.to;
- a.c = a.call;
- a.s = a.set;
- a.toString = function () {
- return "[Tween]"
- };
- a.clone = function () {
- throw "Tween can not be cloned.";
- };
- a._updateTargetProps = function (b, a) {
- var f, d, e, h;
- if (b || 1 != a) {
- if (this.passive = !!b.v, this.passive) return;
- b.e && (a = b.e(a, 0, 1, 1));
- f = b.p0;
- d = b.p1
- } else this.passive = !1, f = d = this._curQueueProps;
- for (var k in this._initQueueProps) {
- null == (e = f[k]) && (f[k] = e = this._initQueueProps[k]);
- null == (h = d[k]) && (d[k] = h = e);
- e = e == h || 0 == a || 1 == a || "number" != typeof e ? 1 == a ? h : e : e + (h - e) * a;
- var m = !1;
- if (h = c._plugins[k])
- for (var n = 0, p = h.length; p > n; n++) {
- var r = h[n].tween(this, k, e, f, d, a, !!b && f == d, !b);
- r == c.IGNORE ? m = !0 : e = r
- }
- m || (this._target[k] = e)
- }
- };
- a._runActions = function (b, a, c) {
- var d = b,
- e = a,
- h = -1,
- k = this._actions.length,
- m = 1;
- for (b > a && (d = a, e = b, h = k, k = m = -1);
- (h += m) != k;) {
- a = this._actions[h];
- var n = a.t;
- (n == e || n > d && e > n || c && n == b) && a.f.apply(a.o, a.p)
- }
- };
- a._appendQueueProps = function (b) {
- var a, f, d, e, h, k;
- for (k in b)
- if (void 0 === this._initQueueProps[k]) {
- if (f = this._target[k], a = c._plugins[k])
- for (d = 0, e = a.length; e > d; d++) f = a[d].init(this,
- k, f);
- this._initQueueProps[k] = this._curQueueProps[k] = void 0 === f ? null : f
- }
- for (k in b) {
- if (f = this._curQueueProps[k], a = c._plugins[k])
- for (h = h || {}, d = 0, e = a.length; e > d; d++) a[d].step && a[d].step(this, k, f, b[k], h);
- this._curQueueProps[k] = b[k]
- }
- return h && this._appendQueueProps(h), this._curQueueProps
- };
- a._cloneProps = function (b) {
- var a = {},
- c;
- for (c in b) a[c] = b[c];
- return a
- };
- a._addStep = function (b) {
- return 0 < b.d && (this._steps.push(b), b.t = this.duration, this.duration += b.d), this
- };
- a._addAction = function (b) {
- return b.t = this.duration,
- this._actions.push(b), this
- };
- a._set = function (b, a) {
- for (var c in b) a[c] = b[c]
- };
- createjs.Tween = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (b, a, c) {
- this.initialize(b, a, c)
- },
- a = c.prototype = new createjs.EventDispatcher;
- a.ignoreGlobalPause = !1;
- a.duration = 0;
- a.loop = !1;
- a.position = null;
- a._paused = !1;
- a._tweens = null;
- a._labels = null;
- a._labelList = null;
- a._prevPosition = 0;
- a._prevPos = -1;
- a._useTicks = !1;
- a.initialize = function (b, a, c) {
- this._tweens = [];
- c && (this._useTicks = c.useTicks, this.loop = c.loop, this.ignoreGlobalPause = c.ignoreGlobalPause, c.onChange && this.addEventListener("change", c.onChange));
- b && this.addTween.apply(this, b);
- this.setLabels(a);
- c && c.paused ? this._paused = !0 : createjs.Tween._register(this, !0);
- c && null != c.position && this.setPosition(c.position, createjs.Tween.NONE)
- };
- a.addTween = function (b) {
- var a = arguments.length;
- if (1 < a) {
- for (var c = 0; a > c; c++) this.addTween(arguments[c]);
- return arguments[0]
- }
- return 0 == a ? null : (this.removeTween(b), this._tweens.push(b), b.setPaused(!0), b._paused = !1, b._useTicks = this._useTicks, b.duration > this.duration && (this.duration = b.duration), 0 <= this._prevPos && b.setPosition(this._prevPos, createjs.Tween.NONE), b)
- };
- a.removeTween =
- function (b) {
- var a = arguments.length;
- if (1 < a) {
- for (var c = !0, d = 0; a > d; d++) c = c && this.removeTween(arguments[d]);
- return c
- }
- if (0 == a) return !1;
- a = this._tweens;
- for (d = a.length; d--;)
- if (a[d] == b) return a.splice(d, 1), b.duration >= this.duration && this.updateDuration(), !0;
- return !1
- };
- a.addLabel = function (b, a) {
- this._labels[b] = a;
- var c = this._labelList;
- if (c) {
- for (var d = 0, e = c.length; e > d && !(a < c[d].position); d++);
- c.splice(d, 0, {
- label: b,
- position: a
- })
- }
- };
- a.setLabels = function (b) {
- this._labels = b ? b : {}
- };
- a.getLabels = function () {
- var b = this._labelList;
- if (!b) {
- var b = this._labelList = [],
- a = this._labels,
- c;
- for (c in a) b.push({
- label: c,
- position: a[c]
- });
- b.sort(function (b, a) {
- return b.position - a.position
- })
- }
- return b
- };
- a.getCurrentLabel = function () {
- var b = this.getLabels(),
- a = this.position,
- c = b.length;
- if (c) {
- for (var d = 0; c > d && !(a < b[d].position); d++);
- return 0 == d ? null : b[d - 1].label
- }
- return null
- };
- a.gotoAndPlay = function (b) {
- this.setPaused(!1);
- this._goto(b)
- };
- a.gotoAndStop = function (b) {
- this.setPaused(!0);
- this._goto(b)
- };
- a.setPosition = function (b, a) {
- 0 > b && (b = 0);
- var c = this.loop ? b % this.duration :
- b,
- d = !this.loop && b >= this.duration;
- if (c == this._prevPos) return d;
- this._prevPosition = b;
- this.position = this._prevPos = c;
- for (var e = 0, h = this._tweens.length; h > e; e++)
- if (this._tweens[e].setPosition(c, a), c != this._prevPos) return !1;
- return d && this.setPaused(!0), this.dispatchEvent("change"), d
- };
- a.setPaused = function (a) {
- this._paused = !!a;
- createjs.Tween._register(this, !a)
- };
- a.updateDuration = function () {
- for (var a = this.duration = 0, c = this._tweens.length; c > a; a++) {
- var f = this._tweens[a];
- f.duration > this.duration && (this.duration =
- f.duration)
- }
- };
- a.tick = function (a) {
- this.setPosition(this._prevPosition + a)
- };
- a.resolve = function (a) {
- var c = parseFloat(a);
- return isNaN(c) && (c = this._labels[a]), c
- };
- a.toString = function () {
- return "[Timeline]"
- };
- a.clone = function () {
- throw "Timeline can not be cloned.";
- };
- a._goto = function (a) {
- a = this.resolve(a);
- null != a && this.setPosition(a)
- };
- createjs.Timeline = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function () {
- throw "Ease cannot be instantiated.";
- };
- c.linear = function (a) {
- return a
- };
- c.none = c.linear;
- c.get = function (a) {
- return -1 > a && (a = -1), 1 < a && (a = 1),
- function (b) {
- return 0 == a ? b : 0 > a ? b * (b * -a + 1 + a) : b * ((2 - b) * a + (1 - a))
- }
- };
- c.getPowIn = function (a) {
- return function (b) {
- return Math.pow(b, a)
- }
- };
- c.getPowOut = function (a) {
- return function (b) {
- return 1 - Math.pow(1 - b, a)
- }
- };
- c.getPowInOut = function (a) {
- return function (b) {
- return 1 > (b *= 2) ? 0.5 * Math.pow(b, a) : 1 - 0.5 * Math.abs(Math.pow(2 - b, a))
- }
- };
- c.quadIn = c.getPowIn(2);
- c.quadOut =
- c.getPowOut(2);
- c.quadInOut = c.getPowInOut(2);
- c.cubicIn = c.getPowIn(3);
- c.cubicOut = c.getPowOut(3);
- c.cubicInOut = c.getPowInOut(3);
- c.quartIn = c.getPowIn(4);
- c.quartOut = c.getPowOut(4);
- c.quartInOut = c.getPowInOut(4);
- c.quintIn = c.getPowIn(5);
- c.quintOut = c.getPowOut(5);
- c.quintInOut = c.getPowInOut(5);
- c.sineIn = function (a) {
- return 1 - Math.cos(a * Math.PI / 2)
- };
- c.sineOut = function (a) {
- return Math.sin(a * Math.PI / 2)
- };
- c.sineInOut = function (a) {
- return -0.5 * (Math.cos(Math.PI * a) - 1)
- };
- c.getBackIn = function (a) {
- return function (b) {
- return b *
- b * ((a + 1) * b - a)
- }
- };
- c.backIn = c.getBackIn(1.7);
- c.getBackOut = function (a) {
- return function (b) {
- return --b * b * ((a + 1) * b + a) + 1
- }
- };
- c.backOut = c.getBackOut(1.7);
- c.getBackInOut = function (a) {
- return a *= 1.525,
- function (b) {
- return 1 > (b *= 2) ? 0.5 * b * b * ((a + 1) * b - a) : 0.5 * ((b -= 2) * b * ((a + 1) * b + a) + 2)
- }
- };
- c.backInOut = c.getBackInOut(1.7);
- c.circIn = function (a) {
- return -(Math.sqrt(1 - a * a) - 1)
- };
- c.circOut = function (a) {
- return Math.sqrt(1 - --a * a)
- };
- c.circInOut = function (a) {
- return 1 > (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
- };
- c.bounceIn =
- function (a) {
- return 1 - c.bounceOut(1 - a)
- };
- c.bounceOut = function (a) {
- return 1 / 2.75 > a ? 7.5625 * a * a : 2 / 2.75 > a ? 7.5625 * (a -= 1.5 / 2.75) * a + 0.75 : 2.5 / 2.75 > a ? 7.5625 * (a -= 2.25 / 2.75) * a + 0.9375 : 7.5625 * (a -= 2.625 / 2.75) * a + 0.984375
- };
- c.bounceInOut = function (a) {
- return 0.5 > a ? 0.5 * c.bounceIn(2 * a) : 0.5 * c.bounceOut(2 * a - 1) + 0.5
- };
- c.getElasticIn = function (a, b) {
- var c = 2 * Math.PI;
- return function (f) {
- if (0 == f || 1 == f) return f;
- var d = b / c * Math.asin(1 / a);
- return -(a * Math.pow(2, 10 * (f -= 1)) * Math.sin((f - d) * c / b))
- }
- };
- c.elasticIn = c.getElasticIn(1, 0.3);
- c.getElasticOut =
- function (a, b) {
- var c = 2 * Math.PI;
- return function (f) {
- if (0 == f || 1 == f) return f;
- var d = b / c * Math.asin(1 / a);
- return a * Math.pow(2, -10 * f) * Math.sin((f - d) * c / b) + 1
- }
- };
- c.elasticOut = c.getElasticOut(1, 0.3);
- c.getElasticInOut = function (a, b) {
- var c = 2 * Math.PI;
- return function (f) {
- var d = b / c * Math.asin(1 / a);
- return 1 > (f *= 2) ? -0.5 * a * Math.pow(2, 10 * (f -= 1)) * Math.sin((f - d) * c / b) : 0.5 * a * Math.pow(2, -10 * (f -= 1)) * Math.sin((f - d) * c / b) + 1
- }
- };
- c.elasticInOut = c.getElasticInOut(1, 0.3 * 1.5);
- createjs.Ease = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function () {
- throw "MotionGuidePlugin cannot be instantiated.";
- };
- c.priority = 0;
- c._rotOffS;
- c._rotOffE;
- c._rotNormS;
- c._rotNormE;
- c.install = function () {
- return createjs.Tween.installPlugin(c, ["guide", "x", "y", "rotation"]), createjs.Tween.IGNORE
- };
- c.init = function (a, b, c) {
- var f = a.target;
- return f.hasOwnProperty("x") || (f.x = 0), f.hasOwnProperty("y") || (f.y = 0), f.hasOwnProperty("rotation") || (f.rotation = 0), "rotation" == b && (a.__needsRot = !0), "guide" == b ? null : c
- };
- c.step = function (a, b, g, f, d) {
- if ("rotation" == b && (a.__rotGlobalS =
- g, a.__rotGlobalE = f, c.testRotData(a, d)), "guide" != b) return f;
- var e;
- f.hasOwnProperty("path") || (f.path = []);
- b = f.path;
- if (f.hasOwnProperty("end") || (f.end = 1), f.hasOwnProperty("start") || (f.start = g && g.hasOwnProperty("end") && g.path === b ? g.end : 0), f.hasOwnProperty("_segments") && f._length) return f;
- g = b.length;
- if (!(6 <= g && 0 == (g - 2) % 4)) throw "invalid 'path' data, please see documentation for valid paths";
- f._segments = [];
- f._length = 0;
- for (var h = 2; g > h; h += 4) {
- for (var k, m, n = b[h - 2], p = b[h - 1], r = b[h + 0], s = b[h + 1], t = b[h + 2], q = b[h + 3],
- w = n, u = p, x = 0, K = [], A = 1; 10 >= A; A++) {
- m = A / 10;
- var y = 1 - m;
- k = y * y * n + 2 * y * m * r + m * m * t;
- m = y * y * p + 2 * y * m * s + m * m * q;
- x += K[K.push(Math.sqrt((e = k - w) * e + (e = m - u) * e)) - 1];
- w = k;
- u = m
- }
- f._segments.push(x);
- f._segments.push(K);
- f._length += x
- }
- e = f.orient;
- f.orient = !0;
- b = {};
- return c.calc(f, f.start, b), a.__rotPathS = Number(b.rotation.toFixed(5)), c.calc(f, f.end, b), a.__rotPathE = Number(b.rotation.toFixed(5)), f.orient = !1, c.calc(f, f.end, d), f.orient = e, f.orient ? (a.__guideData = f, c.testRotData(a, d), f) : f
- };
- c.testRotData = function (a, b) {
- if (void 0 === a.__rotGlobalS ||
- void 0 === a.__rotGlobalE) {
- if (a.__needsRot) return;
- a.__rotGlobalS = a.__rotGlobalE = void 0 !== a._curQueueProps.rotation ? a._curQueueProps.rotation : b.rotation = a.target.rotation || 0
- }
- if (void 0 !== a.__guideData) {
- var c = a.__guideData,
- f = a.__rotGlobalE - a.__rotGlobalS,
- d = a.__rotPathE - a.__rotPathS,
- e = f - d;
- if ("auto" == c.orient) 180 < e ? e -= 360 : -180 > e && (e += 360);
- else if ("cw" == c.orient) {
- for (; 0 > e;) e += 360;
- 0 == e && 0 < f && 180 != f && (e += 360)
- } else if ("ccw" == c.orient) {
- for (e = f - (180 < d ? 360 - d : d); 0 < e;) e -= 360;
- 0 == e && 0 > f && -180 != f && (e -= 360)
- }
- c.rotDelta =
- e;
- c.rotOffS = a.__rotGlobalS - a.__rotPathS;
- a.__rotGlobalS = a.__rotGlobalE = a.__guideData = a.__needsRot = void 0
- }
- };
- c.tween = function (a, b, g, f, d, e, h) {
- d = d.guide;
- if (void 0 == d || d === f.guide) return g;
- if (d.lastRatio != e) {
- switch (c.calc(d, (d.end - d.start) * (h ? d.end : e) + d.start, a.target), d.orient) {
- case "cw":
- case "ccw":
- case "auto":
- a.target.rotation += d.rotOffS + d.rotDelta * e;
- break;
- default:
- a.target.rotation += d.rotOffS
- }
- d.lastRatio = e
- }
- return "rotation" != b || d.orient && "false" != d.orient ? a.target[b] : g
- };
- c.calc = function (a, b, g) {
- void 0 ==
- a._segments && c.validate(a);
- void 0 == g && (g = {
- x: 0,
- y: 0,
- rotation: 0
- });
- var f = a._segments,
- d = a.path,
- e = a._length * b,
- h = f.length - 2;
- for (b = 0; e > f[b] && h > b;) e -= f[b], b += 2;
- for (var f = f[b + 1], k = 0, h = f.length - 1; e > f[k] && h > k;) e -= f[k], k++;
- e = k / ++h + e / (h * f[k]);
- b = 2 * b + 2;
- h = 1 - e;
- return g.x = h * h * d[b - 2] + 2 * h * e * d[b + 0] + e * e * d[b + 2], g.y = h * h * d[b - 1] + 2 * h * e * d[b + 1] + e * e * d[b + 3], a.orient && (g.rotation = 57.2957795 * Math.atan2((d[b + 1] - d[b - 1]) * h + (d[b + 3] - d[b + 1]) * e, (d[b + 0] - d[b - 2]) * h + (d[b + 2] - d[b + 0]) * e)), g
- };
- createjs.MotionGuidePlugin = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = createjs.TweenJS = createjs.TweenJS || {};
- c.version = "0.5.0";
- c.buildDate = "Wed, 25 Sep 2013 17:09:35 GMT"
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = createjs.SoundJS = createjs.SoundJS || {};
- c.version = "0.5.0";
- c.buildDate = "Wed, 25 Sep 2013 17:09:35 GMT"
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function () {},
- a = c.prototype;
- c.initialize = function (b) {
- b.addEventListener = a.addEventListener;
- b.on = a.on;
- b.removeEventListener = b.off = a.removeEventListener;
- b.removeAllEventListeners = a.removeAllEventListeners;
- b.hasEventListener = a.hasEventListener;
- b.dispatchEvent = a.dispatchEvent;
- b._dispatchEvent = a._dispatchEvent
- };
- a._listeners = null;
- a._captureListeners = null;
- a.initialize = function () {};
- a.addEventListener = function (a, c, f) {
- var d;
- d = f ? this._captureListeners = this._captureListeners || {} : this._listeners =
- this._listeners || {};
- var e = d[a];
- return e && this.removeEventListener(a, c, f), e = d[a], e ? e.push(c) : d[a] = [c], c
- };
- a.on = function (a, c, f, d, e, h) {
- return c.handleEvent && (f = f || c, c = c.handleEvent), f = f || this, this.addEventListener(a, function (a) {
- c.call(f, a, e);
- d && a.remove()
- }, h)
- };
- a.removeEventListener = function (a, c, f) {
- if (f = f ? this._captureListeners : this._listeners) {
- var d = f[a];
- if (d)
- for (var e = 0, h = d.length; h > e; e++)
- if (d[e] == c) {
- 1 == h ? delete f[a] : d.splice(e, 1);
- break
- }
- }
- };
- a.off = a.removeEventListener;
- a.removeAllEventListeners = function (a) {
- a ?
- (this._listeners && delete this._listeners[a], this._captureListeners && delete this._captureListeners[a]) : this._listeners = this._captureListeners = null
- };
- a.dispatchEvent = function (a, c) {
- if ("string" == typeof a) {
- var f = this._listeners;
- if (!f || !f[a]) return !1;
- a = new createjs.Event(a)
- }
- if (a.target = c || this, a.bubbles && this.parent) {
- for (var d = this, f = [d]; d.parent;) f.push(d = d.parent);
- for (var e = f.length, d = e - 1; 0 <= d && !a.propagationStopped; d--) f[d]._dispatchEvent(a, 1 + (0 == d));
- for (d = 1; e > d && !a.propagationStopped; d++) f[d]._dispatchEvent(a,
- 3)
- } else this._dispatchEvent(a, 2);
- return a.defaultPrevented
- };
- a.hasEventListener = function (a) {
- var c = this._listeners,
- f = this._captureListeners;
- return !!(c && c[a] || f && f[a])
- };
- a.toString = function () {
- return "[EventDispatcher]"
- };
- a._dispatchEvent = function (a, c) {
- var f, d = 1 == c ? this._captureListeners : this._listeners;
- if (a && d && (d = d[a.type]) && (f = d.length)) {
- a.currentTarget = this;
- a.eventPhase = c;
- a.removed = !1;
- for (var d = d.slice(), e = 0; f > e && !a.immediatePropagationStopped; e++) {
- var h = d[e];
- h.handleEvent ? h.handleEvent(a) : h(a);
- a.removed &&
- (this.off(a.type, h, 1 == c), a.removed = !1)
- }
- }
- };
- createjs.EventDispatcher = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- var c = function (a, c, f) {
- this.initialize(a, c, f)
- },
- a = c.prototype;
- a.type = null;
- a.target = null;
- a.currentTarget = null;
- a.eventPhase = 0;
- a.bubbles = !1;
- a.cancelable = !1;
- a.timeStamp = 0;
- a.defaultPrevented = !1;
- a.propagationStopped = !1;
- a.immediatePropagationStopped = !1;
- a.removed = !1;
- a.initialize = function (a, c, f) {
- this.type = a;
- this.bubbles = c;
- this.cancelable = f;
- this.timeStamp = (new Date)
- .getTime()
- };
- a.preventDefault = function () {
- this.defaultPrevented = !0
- };
- a.stopPropagation = function () {
- this.propagationStopped = !0
- };
- a.stopImmediatePropagation =
- function () {
- this.immediatePropagationStopped = this.propagationStopped = !0
- };
- a.remove = function () {
- this.removed = !0
- };
- a.clone = function () {
- return new c(this.type, this.bubbles, this.cancelable)
- };
- a.toString = function () {
- return "[Event (type=" + this.type + ")]"
- };
- createjs.Event = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- createjs.indexOf = function (c, a) {
- for (var b = 0, g = c.length; g > b; b++)
- if (a === c[b]) return b;
- return -1
- }
- })();
- this.createjs = this.createjs || {};
- (function () {
- createjs.proxy = function (c, a) {
- var b = Array.prototype.slice.call(arguments, 2);
- return function () {
- return c.apply(a, Array.prototype.slice.call(arguments, 0)
- .concat(b))
- }
- }
- })();
- this.createjs = this.createjs || {};
- (function () {
- function c() {
- throw "Sound cannot be instantiated";
- }
- function a(a, b) {
- this.init(a, b)
- }
- function b() {}
- c.DELIMITER = "|";
- c.AUDIO_TIMEOUT = 8E3;
- c.INTERRUPT_ANY = "any";
- c.INTERRUPT_EARLY = "early";
- c.INTERRUPT_LATE = "late";
- c.INTERRUPT_NONE = "none";
- c.PLAY_INITED = "playInited";
- c.PLAY_SUCCEEDED = "playSucceeded";
- c.PLAY_INTERRUPTED = "playInterrupted";
- c.PLAY_FINISHED = "playFinished";
- c.PLAY_FAILED = "playFailed";
- c.SUPPORTED_EXTENSIONS = "mp3 ogg mpeg wav m4a mp4 aiff wma mid".split(" ");
- c.EXTENSION_MAP = {
- m4a: "mp4"
- };
- c.FILE_PATTERN =
- /^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/;
- c.defaultInterruptBehavior = c.INTERRUPT_NONE;
- c.lastId = 0;
- c.activePlugin = null;
- c.pluginsRegistered = !1;
- c.masterVolume = 1;
- c.masterMute = !1;
- c.instances = [];
- c.idHash = {};
- c.preloadHash = {};
- c.defaultSoundInstance = null;
- c.addEventListener = null;
- c.removeEventListener = null;
- c.removeAllEventListeners = null;
- c.dispatchEvent = null;
- c.hasEventListener = null;
- c._listeners = null;
- createjs.EventDispatcher.initialize(c);
- c.sendFileLoadEvent = function (a) {
- if (c.preloadHash[a])
- for (var b =
- 0, e = c.preloadHash[a].length; e > b; b++) {
- var g = c.preloadHash[a][b];
- if (c.preloadHash[a][b] = !0, c.hasEventListener("fileload")) {
- var k = new createjs.Event("fileload");
- k.src = g.src;
- k.id = g.id;
- k.data = g.data;
- c.dispatchEvent(k)
- }
- }
- };
- c.getPreloadHandlers = function () {
- return {
- callback: createjs.proxy(c.initLoad, c),
- types: ["sound"],
- extensions: c.SUPPORTED_EXTENSIONS
- }
- };
- c.registerPlugin = function (a) {
- return c.pluginsRegistered = !0, null == a ? !1 : a.isSupported() ? (c.activePlugin = new a, !0) : !1
- };
- c.registerPlugins = function (a) {
- for (var b =
- 0, e = a.length; e > b; b++)
- if (c.registerPlugin(a[b])) return !0;
- return !1
- };
- c.initializeDefaultPlugins = function () {
- return null != c.activePlugin ? !0 : c.pluginsRegistered ? !1 : c.registerPlugins([createjs.WebAudioPlugin, createjs.HTMLAudioPlugin]) ? !0 : !1
- };
- c.isReady = function () {
- return null != c.activePlugin
- };
- c.getCapabilities = function () {
- return null == c.activePlugin ? null : c.activePlugin.capabilities
- };
- c.getCapability = function (a) {
- return null == c.activePlugin ? null : c.activePlugin.capabilities[a]
- };
- c.initLoad = function (a, b, e, g, k) {
- a =
- c.registerSound(a, e, g, !1, k);
- return null == a ? !1 : a
- };
- c.registerSound = function (b, d, e, g, k) {
- if (!c.initializeDefaultPlugins()) return !1;
- b instanceof Object && (k = d, d = b.id, e = b.data, b = b.src);
- var m = c.parsePath(b, "sound", d, e);
- if (null == m) return !1;
- null != d && (c.idHash[d] = m.src);
- var n = null;
- null != e && (isNaN(e.channels) ? isNaN(e) || (n = parseInt(e)) : n = parseInt(e.channels));
- var p = c.activePlugin.register(m.src, n);
- if (null != p && (null != p.numChannels && (n = p.numChannels), a.create(m.src, n), null != e && isNaN(e) ? e.channels = m.data.channels =
- n || a.maxPerChannel() : e = m.data = n || a.maxPerChannel(), null != p.tag ? m.tag = p.tag : p.src && (m.src = p.src), null != p.completeHandler && (m.completeHandler = p.completeHandler), p.type && (m.type = p.type)), 0 != g)
- if (c.preloadHash[m.src] || (c.preloadHash[m.src] = []), c.preloadHash[m.src].push({
- src: b,
- id: d,
- data: e
- }), 1 == c.preloadHash[m.src].length) null == k && (k = ""), c.activePlugin.preload(m.src, p, k);
- else if (1 == c.preloadHash[m.src][0]) return !0;
- return m
- };
- c.registerManifest = function (a, b) {
- for (var c = [], g = 0, k = a.length; k > g; g++) c[g] = createjs.Sound.registerSound(a[g].src,
- a[g].id, a[g].data, a[g].preload, b);
- return c
- };
- c.removeSound = function (b) {
- if (null == c.activePlugin) return !1;
- b instanceof Object && (b = b.src);
- b = c.getSrcById(b);
- b = c.parsePath(b);
- if (null == b) return !1;
- b = b.src;
- for (var d in c.idHash) c.idHash[d] == b && delete c.idHash[d];
- return a.removeSrc(b), delete c.preloadHash[b], c.activePlugin.removeSound(b), !0
- };
- c.removeManifest = function (a) {
- for (var b = [], c = 0, g = a.length; g > c; c++) b[c] = createjs.Sound.removeSound(a[c].src);
- return b
- };
- c.removeAllSounds = function () {
- c.idHash = {};
- c.preloadHash = {};
- a.removeAll();
- c.activePlugin.removeAllSounds()
- };
- c.loadComplete = function (a) {
- var b = c.parsePath(a, "sound");
- return a = b ? c.getSrcById(b.src) : c.getSrcById(a), 1 == c.preloadHash[a][0]
- };
- c.parsePath = function (a, b, e, g) {
- "string" != typeof a && (a = a.toString());
- a = a.split(c.DELIMITER);
- b = {
- type: b || "sound",
- id: e,
- data: g
- };
- e = c.getCapabilities();
- g = 0;
- for (var k = a.length; k > g; g++) {
- var m = a[g],
- n = m.match(c.FILE_PATTERN);
- if (null == n) return !1;
- var p = n[4],
- n = n[5];
- if (e[n] && -1 < createjs.indexOf(c.SUPPORTED_EXTENSIONS, n)) return b.name = p, b.src =
- m, b.extension = n, b
- }
- return null
- };
- c.play = function (a, b, e, g, k, m, n) {
- a = c.createInstance(a);
- return c.playInstance(a, b, e, g, k, m, n) || a.playFailed(), a
- };
- c.createInstance = function (b) {
- if (!c.initializeDefaultPlugins()) return c.defaultSoundInstance;
- b = c.getSrcById(b);
- b = c.parsePath(b, "sound");
- var d = null;
- return null != b && null != b.src ? (a.create(b.src), d = c.activePlugin.create(b.src)) : d = c.defaultSoundInstance, d.uniqueId = c.lastId++, d
- };
- c.setVolume = function (a) {
- if (null == Number(a)) return !1;
- if (a = Math.max(0, Math.min(1, a)), c.masterVolume =
- a, !this.activePlugin || !this.activePlugin.setVolume || !this.activePlugin.setVolume(a))
- for (var b = this.instances, e = 0, g = b.length; g > e; e++) b[e].setMasterVolume(a)
- };
- c.getVolume = function () {
- return c.masterVolume
- };
- c.setMute = function (a) {
- if (null == a || void 0 == a) return !1;
- if (this.masterMute = a, !this.activePlugin || !this.activePlugin.setMute || !this.activePlugin.setMute(a))
- for (var b = this.instances, c = 0, g = b.length; g > c; c++) b[c].setMasterMute(a);
- return !0
- };
- c.getMute = function () {
- return this.masterMute
- };
- c.stop = function () {
- for (var a =
- this.instances, b = a.length; b--;) a[b].stop()
- };
- c.playInstance = function (a, b, e, g, k, m, n) {
- if (b instanceof Object && (e = b.delay, g = b.offset, k = b.loop, m = b.volume, n = b.pan), b = b || c.defaultInterruptBehavior, null == e && (e = 0), null == g && (g = a.getPosition()), null == k && (k = 0), null == m && (m = a.volume), null == n && (n = a.pan), 0 == e) {
- if (!c.beginPlaying(a, b, g, k, m, n)) return !1
- } else e = setTimeout(function () {
- c.beginPlaying(a, b, g, k, m, n)
- }, e), a.delayTimeoutId = e;
- return this.instances.push(a), !0
- };
- c.beginPlaying = function (b, c, e, g, k, m) {
- return a.add(b,
- c) ? b.beginPlaying(e, g, k, m) ? !0 : (b = createjs.indexOf(this.instances, b), -1 < b && this.instances.splice(b, 1), !1) : !1
- };
- c.getSrcById = function (a) {
- return null == c.idHash || null == c.idHash[a] ? a : c.idHash[a]
- };
- c.playFinished = function (b) {
- a.remove(b);
- b = createjs.indexOf(this.instances, b); - 1 < b && this.instances.splice(b, 1)
- };
- createjs.Sound = c;
- a.channels = {};
- a.create = function (b, c) {
- return null == a.get(b) ? (a.channels[b] = new a(b, c), !0) : !1
- };
- a.removeSrc = function (b) {
- var c = a.get(b);
- return null == c ? !1 : (c.removeAll(), delete a.channels[b], !0)
- };
- a.removeAll = function () {
- for (var b in a.channels) a.channels[b].removeAll();
- a.channels = {}
- };
- a.add = function (b, c) {
- var e = a.get(b.src);
- return null == e ? !1 : e.add(b, c)
- };
- a.remove = function (b) {
- var c = a.get(b.src);
- return null == c ? !1 : (c.remove(b), !0)
- };
- a.maxPerChannel = function () {
- return g.maxDefault
- };
- a.get = function (b) {
- return a.channels[b]
- };
- var g = a.prototype;
- g.src = null;
- g.max = null;
- g.maxDefault = 100;
- g.length = 0;
- g.init = function (a, b) {
- this.src = a;
- this.max = b || this.maxDefault; - 1 == this.max && this.max == this.maxDefault;
- this.instances = []
- };
- g.get = function (a) {
- return this.instances[a]
- };
- g.add = function (a, b) {
- return this.getSlot(b, a) ? (this.instances.push(a), this.length++, !0) : !1
- };
- g.remove = function (a) {
- a = createjs.indexOf(this.instances, a);
- return -1 == a ? !1 : (this.instances.splice(a, 1), this.length--, !0)
- };
- g.removeAll = function () {
- for (var a = this.length - 1; 0 <= a; a--) this.instances[a].stop()
- };
- g.getSlot = function (a) {
- for (var b, e, g = 0, k = this.max; k > g; g++) {
- if (b = this.get(g), null == b) return !0;
- (a != c.INTERRUPT_NONE || b.playState == c.PLAY_FINISHED) && (0 != g ? b.playState ==
- c.PLAY_FINISHED || b.playState == c.PLAY_INTERRUPTED || b.playState == c.PLAY_FAILED ? e = b : (a == c.INTERRUPT_EARLY && b.getPosition() < e.getPosition() || a == c.INTERRUPT_LATE && b.getPosition() > e.getPosition()) && (e = b) : e = b)
- }
- return null != e ? (e.interrupt(), this.remove(e), !0) : !1
- };
- g.toString = function () {
- return "[Sound SoundChannel]"
- };
- c.defaultSoundInstance = new function () {
- this.isDefault = !0;
- this.addEventListener = this.removeEventListener = this.removeAllEventListener = this.dispatchEvent = this.hasEventListener = this._listeners = this.interrupt =
- this.playFailed = this.pause = this.resume = this.play = this.beginPlaying = this.cleanUp = this.stop = this.setMasterVolume = this.setVolume = this.mute = this.setMute = this.getMute = this.setPan = this.getPosition = this.setPosition = function () {
- return !1
- };
- this.getVolume = this.getPan = this.getDuration = function () {
- return 0
- };
- this.playState = c.PLAY_FAILED;
- this.toString = function () {
- return "[Sound Default Sound Instance]"
- }
- };
- null == createjs.proxy && (createjs.proxy = function () {
- throw "Proxy has been moved to an external file, and must be included separately.";
- });
- b.init = function () {
- var a = window.navigator.userAgent;
- b.isFirefox = -1 < a.indexOf("Firefox");
- b.isOpera = null != window.opera;
- b.isChrome = -1 < a.indexOf("Chrome");
- b.isIOS = -1 < a.indexOf("iPod") || -1 < a.indexOf("iPhone") || -1 < a.indexOf("iPad");
- b.isAndroid = -1 < a.indexOf("Android");
- b.isBlackberry = -1 < a.indexOf("Blackberry")
- };
- b.init();
- createjs.Sound.BrowserDetect = b
- })();
- this.createjs = this.createjs || {};
- (function () {
- function c() {
- this.init()
- }
- c.capabilities = null;
- c.isSupported = function () {
- var a = createjs.Sound.BrowserDetect.isIOS || createjs.Sound.BrowserDetect.isAndroid || createjs.Sound.BrowserDetect.isBlackberry;
- return "file:" != location.protocol || a || this.isFileXHRSupported() ? (c.generateCapabilities(), null == c.context ? !1 : !0) : !1
- };
- c.isFileXHRSupported = function () {
- var a = !0,
- c = new XMLHttpRequest;
- try {
- c.open("GET", "fail.fail", !1)
- } catch (f) {
- return a = !1
- }
- c.onerror = function () {
- a = !1
- };
- c.onload = function () {
- a = 404 == this.status ||
- 200 == this.status || 0 == this.status && "" != this.response
- };
- try {
- c.send()
- } catch (d) {
- a = !1
- }
- return a
- };
- c.generateCapabilities = function () {
- if (null == c.capabilities) {
- var a = document.createElement("audio");
- if (null == a.canPlayType) return null;
- if (window.webkitAudioContext) c.context = new webkitAudioContext;
- else {
- if (!window.AudioContext) return null;
- c.context = new AudioContext
- }
- c.compatibilitySetUp();
- c.playEmptySound();
- c.capabilities = {
- panning: !0,
- volume: !0,
- tracks: -1
- };
- for (var g = createjs.Sound.SUPPORTED_EXTENSIONS, f = createjs.Sound.EXTENSION_MAP,
- d = 0, e = g.length; e > d; d++) {
- var h = g[d],
- k = f[h] || h;
- c.capabilities[h] = "no" != a.canPlayType("audio/" + h) && "" != a.canPlayType("audio/" + h) || "no" != a.canPlayType("audio/" + k) && "" != a.canPlayType("audio/" + k)
- }
- 2 > c.context.destination.numberOfChannels && (c.capabilities.panning = !1);
- c.dynamicsCompressorNode = c.context.createDynamicsCompressor();
- c.dynamicsCompressorNode.connect(c.context.destination);
- c.gainNode = c.context.createGain();
- c.gainNode.connect(c.dynamicsCompressorNode)
- }
- };
- c.compatibilitySetUp = function () {
- if (!c.context.createGain) {
- c.context.createGain =
- c.context.createGainNode;
- var a = c.context.createBufferSource();
- a.__proto__.start = a.__proto__.noteGrainOn;
- a.__proto__.stop = a.__proto__.noteOff;
- this.panningModel = 0
- }
- };
- c.playEmptySound = function () {
- var a = this.context.createBuffer(1, 1, 22050),
- c = this.context.createBufferSource();
- c.buffer = a;
- c.connect(this.context.destination);
- c.start(0, 0, 0)
- };
- var a = c.prototype;
- a.capabilities = null;
- a.volume = 1;
- a.context = null;
- a.panningModel = "equalpower";
- a.dynamicsCompressorNode = null;
- a.gainNode = null;
- a.arrayBuffers = null;
- a.init = function () {
- this.capabilities =
- c.capabilities;
- this.arrayBuffers = {};
- this.context = c.context;
- this.gainNode = c.gainNode;
- this.dynamicsCompressorNode = c.dynamicsCompressorNode
- };
- a.register = function (a) {
- this.arrayBuffers[a] = !0;
- return {
- tag: new createjs.WebAudioPlugin.Loader(a, this)
- }
- };
- a.isPreloadStarted = function (a) {
- return null != this.arrayBuffers[a]
- };
- a.isPreloadComplete = function (a) {
- return !(null == this.arrayBuffers[a] || 1 == this.arrayBuffers[a])
- };
- a.removeFromPreload = function (a) {
- delete this.arrayBuffers[a]
- };
- a.removeSound = function (a) {
- delete this.arrayBuffers[a]
- };
- a.removeAllSounds = function () {
- this.arrayBuffers = {}
- };
- a.addPreloadResults = function (a, c) {
- this.arrayBuffers[a] = c
- };
- a.handlePreloadComplete = function () {
- createjs.Sound.sendFileLoadEvent(this.src)
- };
- a.preload = function (a, c, f) {
- this.arrayBuffers[a] = !0;
- a = new createjs.WebAudioPlugin.Loader(a, this);
- a.onload = this.handlePreloadComplete;
- null != f && (a.src = f + a.src);
- a.load()
- };
- a.create = function (a) {
- return this.isPreloadStarted(a) || this.preload(a), new createjs.WebAudioPlugin.SoundInstance(a, this)
- };
- a.setVolume = function (a) {
- return this.volume =
- a, this.updateVolume(), !0
- };
- a.updateVolume = function () {
- var a = createjs.Sound.masterMute ? 0 : this.volume;
- a != this.gainNode.gain.value && (this.gainNode.gain.value = a)
- };
- a.getVolume = function () {
- return this.volume
- };
- a.setMute = function () {
- return this.updateVolume(), !0
- };
- a.toString = function () {
- return "[WebAudioPlugin]"
- };
- createjs.WebAudioPlugin = c
- })();
- (function () {
- function c(a, c) {
- this.init(a, c)
- }
- var a = c.prototype;
- a.src = null;
- a.uniqueId = -1;
- a.playState = null;
- a.owner = null;
- a.offset = 0;
- a.delay = 0;
- a._volume = 1;
- Object.defineProperty(a, "volume", {
- get: function () {
- return this._volume
- },
- set: function (a) {
- return null == Number(a) ? !1 : (a = Math.max(0, Math.min(1, a)), this._volume = a, this.updateVolume(), void 0)
- }
- });
- a._pan = 0;
- Object.defineProperty(a, "pan", {
- get: function () {
- return this._pan
- },
- set: function (a) {
- return this.owner.capabilities.panning && null != Number(a) ? (a = Math.max(-1, Math.min(1,
- a)), this._pan = a, this.panNode.setPosition(a, 0, -0.5), void 0) : !1
- }
- });
- a.duration = 0;
- a.remainingLoops = 0;
- a.delayTimeoutId = null;
- a.soundCompleteTimeout = null;
- a.panNode = null;
- a.gainNode = null;
- a.sourceNode = null;
- a.sourceNodeNext = null;
- a.muted = !1;
- a.paused = !1;
- a.startTime = 0;
- a.addEventListener = null;
- a.removeEventListener = null;
- a.removeAllEventListeners = null;
- a.dispatchEvent = null;
- a.hasEventListener = null;
- a._listeners = null;
- a.endedHandler = null;
- a.readyHandler = null;
- a.stalledHandler = null;
- a.sendEvent = function (a) {
- a = new createjs.Event(a);
- this.dispatchEvent(a)
- };
- a.init = function (a, c) {
- this.owner = c;
- this.src = a;
- this.panNode = this.owner.context.createPanner();
- this.panNode.panningModel = this.owner.panningModel;
- this.gainNode = this.owner.context.createGain();
- this.gainNode.connect(this.panNode);
- this.owner.isPreloadComplete(this.src) && (this.duration = 1E3 * this.owner.arrayBuffers[this.src].duration);
- this.endedHandler = createjs.proxy(this.handleSoundComplete, this);
- this.readyHandler = createjs.proxy(this.handleSoundReady, this);
- this.stalledHandler = createjs.proxy(this.handleSoundStalled,
- this)
- };
- a.cleanUp = function () {
- this.sourceNode && this.sourceNode.playbackState != this.sourceNode.UNSCHEDULED_STATE && (this.sourceNode = this.cleanUpAudioNode(this.sourceNode), this.sourceNodeNext = this.cleanUpAudioNode(this.sourceNodeNext));
- 0 != this.panNode.numberOfOutputs && this.panNode.disconnect(0);
- clearTimeout(this.delayTimeoutId);
- clearTimeout(this.soundCompleteTimeout);
- this.startTime = 0;
- null != window.createjs && createjs.Sound.playFinished(this)
- };
- a.cleanUpAudioNode = function (a) {
- return a && (a.stop(0), a.disconnect(this.gainNode),
- a = null), a
- };
- a.interrupt = function () {
- this.playState = createjs.Sound.PLAY_INTERRUPTED;
- this.cleanUp();
- this.paused = !1;
- this.sendEvent("interrupted")
- };
- a.handleSoundStalled = function () {
- this.sendEvent("failed")
- };
- a.handleSoundReady = function () {
- if (null != window.createjs) {
- if (1E3 * this.offset > this.getDuration()) return this.playFailed(), void 0;
- 0 > this.offset && (this.offset = 0);
- this.playState = createjs.Sound.PLAY_SUCCEEDED;
- this.paused = !1;
- this.panNode.connect(this.owner.gainNode);
- var a = this.owner.arrayBuffers[this.src].duration;
- this.sourceNode = this.createAndPlayAudioNode(this.owner.context.currentTime - a, this.offset);
- this.duration = 1E3 * a;
- this.startTime = this.sourceNode.startTime - this.offset;
- this.soundCompleteTimeout = setTimeout(this.endedHandler, 1E3 * (a - this.offset));
- 0 != this.remainingLoops && (this.sourceNodeNext = this.createAndPlayAudioNode(this.startTime, 0))
- }
- };
- a.createAndPlayAudioNode = function (a, c) {
- var f = this.owner.context.createBufferSource();
- return f.buffer = this.owner.arrayBuffers[this.src], f.connect(this.gainNode), this.owner.context.currentTime,
- f.startTime = a + f.buffer.duration, f.start(f.startTime, c, f.buffer.duration - c), f
- };
- a.play = function (a, c, f, d, e, h) {
- this.cleanUp();
- createjs.Sound.playInstance(this, a, c, f, d, e, h)
- };
- a.beginPlaying = function (a, c, f, d) {
- return null != window.createjs && this.src ? (this.offset = a / 1E3, this.remainingLoops = c, this.volume = f, this.pan = d, this.owner.isPreloadComplete(this.src) ? (this.handleSoundReady(null), this.sendEvent("succeeded"), 1) : (this.playFailed(), void 0)) : void 0
- };
- a.pause = function () {
- return this.paused || this.playState != createjs.Sound.PLAY_SUCCEEDED ?
- !1 : (this.paused = !0, this.offset = this.owner.context.currentTime - this.startTime, this.cleanUpAudioNode(this.sourceNode), this.cleanUpAudioNode(this.sourceNodeNext), 0 != this.panNode.numberOfOutputs && this.panNode.disconnect(), clearTimeout(this.delayTimeoutId), clearTimeout(this.soundCompleteTimeout), !0)
- };
- a.resume = function () {
- return this.paused ? (this.handleSoundReady(null), !0) : !1
- };
- a.stop = function () {
- return this.playState = createjs.Sound.PLAY_FINISHED, this.cleanUp(), this.offset = 0, !0
- };
- a.setVolume = function (a) {
- return this.volume =
- a, !0
- };
- a.updateVolume = function () {
- var a = this.muted ? 0 : this._volume;
- return a != this.gainNode.gain.value ? (this.gainNode.gain.value = a, !0) : !1
- };
- a.getVolume = function () {
- return this.volume
- };
- a.setMute = function (a) {
- return null == a || void 0 == a ? !1 : (this.muted = a, this.updateVolume(), !0)
- };
- a.getMute = function () {
- return this.muted
- };
- a.setPan = function (a) {
- return this.pan = a, this.pan != a ? !1 : void 0
- };
- a.getPan = function () {
- return this.pan
- };
- a.getPosition = function () {
- return 1E3 * (this.paused || null == this.sourceNode ? this.offset : this.owner.context.currentTime -
- this.startTime)
- };
- a.setPosition = function (a) {
- return this.offset = a / 1E3, this.sourceNode && this.sourceNode.playbackState != this.sourceNode.UNSCHEDULED_STATE && (this.cleanUpAudioNode(this.sourceNode), this.cleanUpAudioNode(this.sourceNodeNext), clearTimeout(this.soundCompleteTimeout)), this.paused || this.playState != createjs.Sound.PLAY_SUCCEEDED || this.handleSoundReady(null), !0
- };
- a.getDuration = function () {
- return this.duration
- };
- a.handleSoundComplete = function () {
- return this.offset = 0, 0 != this.remainingLoops ? (this.remainingLoops--,
- this.sourceNodeNext ? (this.cleanUpAudioNode(this.sourceNode), this.sourceNode = this.sourceNodeNext, this.startTime = this.sourceNode.startTime, this.sourceNodeNext = this.createAndPlayAudioNode(this.startTime, 0), this.soundCompleteTimeout = setTimeout(this.endedHandler, this.duration)) : this.handleSoundReady(null), this.sendEvent("loop"), void 0) : (null != window.createjs && (this.playState = createjs.Sound.PLAY_FINISHED, this.cleanUp(), this.sendEvent("complete")), void 0)
- };
- a.playFailed = function () {
- null != window.createjs &&
- (this.playState = createjs.Sound.PLAY_FAILED, this.cleanUp(), this.sendEvent("failed"))
- };
- a.toString = function () {
- return "[WebAudioPlugin SoundInstance]"
- };
- createjs.EventDispatcher.initialize(c.prototype);
- createjs.WebAudioPlugin.SoundInstance = c
- })();
- (function () {
- function c(a, c) {
- this.init(a, c)
- }
- var a = c.prototype;
- a.request = null;
- a.owner = null;
- a.progress = -1;
- a.src = null;
- a.originalSrc = null;
- a.result = null;
- a.onload = null;
- a.onprogress = null;
- a.onError = null;
- a.init = function (a, c) {
- this.originalSrc = this.src = a;
- this.owner = c
- };
- a.load = function (a) {
- null != a && (this.src = a);
- this.request = new XMLHttpRequest;
- this.request.open("GET", this.src, !0);
- this.request.responseType = "arraybuffer";
- this.request.onload = createjs.proxy(this.handleLoad, this);
- this.request.onError = createjs.proxy(this.handleError,
- this);
- this.request.onprogress = createjs.proxy(this.handleProgress, this);
- this.request.send()
- };
- a.handleProgress = function (a, c) {
- this.progress = a / c;
- null != this.onprogress && this.onprogress({
- loaded: a,
- total: c,
- progress: this.progress
- })
- };
- a.handleLoad = function () {
- this.owner.context.decodeAudioData(this.request.response, createjs.proxy(this.handleAudioDecoded, this), createjs.proxy(this.handleError, this))
- };
- a.handleAudioDecoded = function (a) {
- this.progress = 1;
- this.result = a;
- this.src = this.originalSrc;
- this.owner.addPreloadResults(this.src,
- this.result);
- this.onload && this.onload()
- };
- a.handleError = function (a) {
- this.owner.removeSound(this.src);
- this.onerror && this.onerror(a)
- };
- a.toString = function () {
- return "[WebAudioPlugin Loader]"
- };
- createjs.WebAudioPlugin.Loader = c
- })();
- this.createjs = this.createjs || {};
- (function () {
- function c() {
- this.init()
- }
- c.MAX_INSTANCES = 30;
- c.capabilities = null;
- c.AUDIO_READY = "canplaythrough";
- c.AUDIO_ENDED = "ended";
- c.AUDIO_SEEKED = "seeked";
- c.AUDIO_ERROR = "error";
- c.AUDIO_STALLED = "stalled";
- c.enableIOS = !1;
- c.isSupported = function () {
- if (createjs.Sound.BrowserDetect.isIOS && !c.enableIOS) return !1;
- c.generateCapabilities();
- return null == c.tag || null == c.capabilities ? !1 : !0
- };
- c.generateCapabilities = function () {
- if (null == c.capabilities) {
- var a = c.tag = document.createElement("audio");
- if (null == a.canPlayType) return null;
- c.capabilities = {
- panning: !0,
- volume: !0,
- tracks: -1
- };
- for (var g = createjs.Sound.SUPPORTED_EXTENSIONS, f = createjs.Sound.EXTENSION_MAP, d = 0, e = g.length; e > d; d++) {
- var h = g[d],
- k = f[h] || h;
- c.capabilities[h] = "no" != a.canPlayType("audio/" + h) && "" != a.canPlayType("audio/" + h) || "no" != a.canPlayType("audio/" + k) && "" != a.canPlayType("audio/" + k)
- }
- }
- };
- var a = c.prototype;
- a.capabilities = null;
- a.audioSources = null;
- a.defaultNumChannels = 2;
- a.loadedHandler = null;
- a.init = function () {
- this.capabilities = c.capabilities;
- this.audioSources = {}
- };
- a.register =
- function (a, c) {
- this.audioSources[a] = !0;
- for (var f = createjs.HTMLAudioPlugin.TagPool.get(a), d = null, e = c || this.defaultNumChannels, h = 0; e > h; h++) d = this.createTag(a), f.add(d);
- if (d.id = a, this.loadedHandler = createjs.proxy(this.handleTagLoad, this), d.addEventListener && d.addEventListener("canplaythrough", this.loadedHandler), null == d.onreadystatechange) d.onreadystatechange = this.loadedHandler;
- else {
- var k = d.onreadystatechange;
- d.onreadystatechange = function () {
- k();
- this.loadedHandler()
- }
- }
- return {
- tag: d,
- numChannels: e
- }
- };
- a.handleTagLoad =
- function (a) {
- a.target.removeEventListener && a.target.removeEventListener("canplaythrough", this.loadedHandler);
- a.target.onreadystatechange = null;
- a.target.src != a.target.id && createjs.HTMLAudioPlugin.TagPool.checkSrc(a.target.id)
- };
- a.createTag = function (a) {
- var c = document.createElement("audio");
- return c.autoplay = !1, c.preload = "none", c.src = a, c
- };
- a.removeSound = function (a) {
- delete this.audioSources[a];
- createjs.HTMLAudioPlugin.TagPool.remove(a)
- };
- a.removeAllSounds = function () {
- this.audioSources = {};
- createjs.HTMLAudioPlugin.TagPool.removeAll()
- };
- a.create = function (a) {
- if (!this.isPreloadStarted(a)) {
- var c = createjs.HTMLAudioPlugin.TagPool.get(a),
- f = this.createTag(a);
- f.id = a;
- c.add(f);
- this.preload(a, {
- tag: f
- })
- }
- return new createjs.HTMLAudioPlugin.SoundInstance(a, this)
- };
- a.isPreloadStarted = function (a) {
- return null != this.audioSources[a]
- };
- a.preload = function (a, c, f) {
- this.audioSources[a] = !0;
- null != f && (c.tag.src = f + a);
- new createjs.HTMLAudioPlugin.Loader(a, c.tag)
- };
- a.toString = function () {
- return "[HTMLAudioPlugin]"
- };
- createjs.HTMLAudioPlugin = c
- })();
- (function () {
- function c(a, c) {
- this.init(a, c)
- }
- var a = c.prototype;
- a.src = null;
- a.uniqueId = -1;
- a.playState = null;
- a.owner = null;
- a.loaded = !1;
- a.offset = 0;
- a.delay = 0;
- a._volume = 1;
- Object.defineProperty(a, "volume", {
- get: function () {
- return this._volume
- },
- set: function (a) {
- null != Number(a) && (a = Math.max(0, Math.min(1, a)), this._volume = a, this.updateVolume())
- }
- });
- a.pan = 0;
- a.duration = 0;
- a.remainingLoops = 0;
- a.delayTimeoutId = null;
- a.tag = null;
- a.muted = !1;
- a.paused = !1;
- a.addEventListener = null;
- a.removeEventListener = null;
- a.removeAllEventListeners =
- null;
- a.dispatchEvent = null;
- a.hasEventListener = null;
- a._listeners = null;
- a.endedHandler = null;
- a.readyHandler = null;
- a.stalledHandler = null;
- a.loopHandler = null;
- a.init = function (a, c) {
- this.src = a;
- this.owner = c;
- this.endedHandler = createjs.proxy(this.handleSoundComplete, this);
- this.readyHandler = createjs.proxy(this.handleSoundReady, this);
- this.stalledHandler = createjs.proxy(this.handleSoundStalled, this);
- this.loopHandler = createjs.proxy(this.handleSoundLoop, this)
- };
- a.sendEvent = function (a) {
- a = new createjs.Event(a);
- this.dispatchEvent(a)
- };
- a.cleanUp = function () {
- var a = this.tag;
- if (null != a) {
- a.pause();
- a.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_ENDED, this.endedHandler, !1);
- a.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_READY, this.readyHandler, !1);
- a.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_SEEKED, this.loopHandler, !1);
- try {
- a.currentTime = 0
- } catch (c) {}
- createjs.HTMLAudioPlugin.TagPool.setInstance(this.src, a);
- this.tag = null
- }
- clearTimeout(this.delayTimeoutId);
- null != window.createjs && createjs.Sound.playFinished(this)
- };
- a.interrupt =
- function () {
- null != this.tag && (this.playState = createjs.Sound.PLAY_INTERRUPTED, this.cleanUp(), this.paused = !1, this.sendEvent("interrupted"))
- };
- a.play = function (a, c, f, d, e, h) {
- this.cleanUp();
- createjs.Sound.playInstance(this, a, c, f, d, e, h)
- };
- a.beginPlaying = function (a, c, f, d) {
- if (null == window.createjs) return -1;
- var e = this.tag = createjs.HTMLAudioPlugin.TagPool.getInstance(this.src);
- return null == e ? (this.playFailed(), -1) : (e.addEventListener(createjs.HTMLAudioPlugin.AUDIO_ENDED, this.endedHandler, !1), this.offset = a, this.volume =
- f, this.pan = d, this.updateVolume(), this.remainingLoops = c, 4 !== e.readyState ? (e.addEventListener(createjs.HTMLAudioPlugin.AUDIO_READY, this.readyHandler, !1), e.addEventListener(createjs.HTMLAudioPlugin.AUDIO_STALLED, this.stalledHandler, !1), e.preload = "auto", e.load()) : this.handleSoundReady(null), this.sendEvent("succeeded"), 1)
- };
- a.handleSoundStalled = function () {
- this.cleanUp();
- this.sendEvent("failed")
- };
- a.handleSoundReady = function () {
- if (null != window.createjs) {
- if (this.duration = 1E3 * this.tag.duration, this.playState =
- createjs.Sound.PLAY_SUCCEEDED, this.paused = !1, this.tag.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_READY, this.readyHandler, !1), this.offset >= this.getDuration()) return this.playFailed(), void 0;
- 0 < this.offset && (this.tag.currentTime = 0.0010 * this.offset); - 1 == this.remainingLoops && (this.tag.loop = !0);
- 0 != this.remainingLoops && (this.tag.addEventListener(createjs.HTMLAudioPlugin.AUDIO_SEEKED, this.loopHandler, !1), this.tag.loop = !0);
- this.tag.play()
- }
- };
- a.pause = function () {
- return this.paused || this.playState != createjs.Sound.PLAY_SUCCEEDED ||
- null == this.tag ? !1 : (this.paused = !0, this.tag.pause(), clearTimeout(this.delayTimeoutId), !0)
- };
- a.resume = function () {
- return this.paused && null != this.tag ? (this.paused = !1, this.tag.play(), !0) : !1
- };
- a.stop = function () {
- return this.offset = 0, this.pause(), this.playState = createjs.Sound.PLAY_FINISHED, this.cleanUp(), !0
- };
- a.setMasterVolume = function () {
- return this.updateVolume(), !0
- };
- a.setVolume = function (a) {
- return this.volume = a, !0
- };
- a.updateVolume = function () {
- if (null != this.tag) {
- var a = this.muted || createjs.Sound.masterMute ? 0 : this._volume *
- createjs.Sound.masterVolume;
- return a != this.tag.volume && (this.tag.volume = a), !0
- }
- return !1
- };
- a.getVolume = function () {
- return this.volume
- };
- a.setMasterMute = function () {
- return this.updateVolume(), !0
- };
- a.setMute = function (a) {
- return null == a || void 0 == a ? !1 : (this.muted = a, this.updateVolume(), !0)
- };
- a.getMute = function () {
- return this.muted
- };
- a.setPan = function () {
- return !1
- };
- a.getPan = function () {
- return 0
- };
- a.getPosition = function () {
- return null == this.tag ? this.offset : 1E3 * this.tag.currentTime
- };
- a.setPosition = function (a) {
- if (null == this.tag) this.offset =
- a;
- else {
- this.tag.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_SEEKED, this.loopHandler, !1);
- try {
- this.tag.currentTime = 0.0010 * a
- } catch (c) {
- return !1
- }
- this.tag.addEventListener(createjs.HTMLAudioPlugin.AUDIO_SEEKED, this.loopHandler, !1)
- }
- return !0
- };
- a.getDuration = function () {
- return this.duration
- };
- a.handleSoundComplete = function () {
- this.offset = 0;
- null != window.createjs && (this.playState = createjs.Sound.PLAY_FINISHED, this.cleanUp(), this.sendEvent("complete"))
- };
- a.handleSoundLoop = function () {
- this.offset = 0;
- this.remainingLoops--;
- 0 == this.remainingLoops && (this.tag.loop = !1, this.tag.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_SEEKED, this.loopHandler, !1));
- this.sendEvent("loop")
- };
- a.playFailed = function () {
- null != window.createjs && (this.playState = createjs.Sound.PLAY_FAILED, this.cleanUp(), this.sendEvent("failed"))
- };
- a.toString = function () {
- return "[HTMLAudioPlugin SoundInstance]"
- };
- createjs.EventDispatcher.initialize(c.prototype);
- createjs.HTMLAudioPlugin.SoundInstance = c
- })();
- (function () {
- function c(a, c) {
- this.init(a, c)
- }
- var a = c.prototype;
- a.src = null;
- a.tag = null;
- a.preloadTimer = null;
- a.loadedHandler = null;
- a.init = function (a, c) {
- if (this.src = a, this.tag = c, this.preloadTimer = setInterval(createjs.proxy(this.preloadTick, this), 200), this.loadedHandler = createjs.proxy(this.sendLoadedEvent, this), this.tag.addEventListener && this.tag.addEventListener("canplaythrough", this.loadedHandler), null == this.tag.onreadystatechange) this.tag.onreadystatechange = createjs.proxy(this.sendLoadedEvent, this);
- else {
- var f =
- this.tag.onreadystatechange;
- this.tag.onreadystatechange = function () {
- f();
- this.tag.onreadystatechange = createjs.proxy(this.sendLoadedEvent, this)
- }
- }
- this.tag.preload = "auto";
- this.tag.load()
- };
- a.preloadTick = function () {
- var a = this.tag.buffered,
- c = this.tag.duration;
- 0 < a.length && a.end(0) >= c - 1 && this.handleTagLoaded()
- };
- a.handleTagLoaded = function () {
- clearInterval(this.preloadTimer)
- };
- a.sendLoadedEvent = function () {
- this.tag.removeEventListener && this.tag.removeEventListener("canplaythrough", this.loadedHandler);
- this.tag.onreadystatechange =
- null;
- createjs.Sound.sendFileLoadEvent(this.src)
- };
- a.toString = function () {
- return "[HTMLAudioPlugin Loader]"
- };
- createjs.HTMLAudioPlugin.Loader = c
- })();
- (function () {
- function c(a) {
- this.init(a)
- }
- c.tags = {};
- c.get = function (a) {
- var g = c.tags[a];
- return null == g && (g = c.tags[a] = new c(a)), g
- };
- c.remove = function (a) {
- var g = c.tags[a];
- return null == g ? !1 : (g.removeAll(), delete c.tags[a], !0)
- };
- c.removeAll = function () {
- for (var a in c.tags) c.tags[a].removeAll();
- c.tags = {}
- };
- c.getInstance = function (a) {
- a = c.tags[a];
- return null == a ? null : a.get()
- };
- c.setInstance = function (a, g) {
- var f = c.tags[a];
- return null == f ? null : f.set(g)
- };
- c.checkSrc = function (a) {
- a = c.tags[a];
- return null == a ? null : (a.checkSrcChange(),
- void 0)
- };
- var a = c.prototype;
- a.src = null;
- a.length = 0;
- a.available = 0;
- a.tags = null;
- a.init = function (a) {
- this.src = a;
- this.tags = []
- };
- a.add = function (a) {
- this.tags.push(a);
- this.length++;
- this.available++
- };
- a.removeAll = function () {
- for (; this.length--;) delete this.tags[this.length];
- this.src = null;
- this.tags.length = 0
- };
- a.get = function () {
- if (0 == this.tags.length) return null;
- this.available = this.tags.length;
- var a = this.tags.pop();
- return null == a.parentNode && document.body.appendChild(a), a
- };
- a.set = function (a) {
- -1 == createjs.indexOf(this.tags,
- a) && this.tags.push(a);
- this.available = this.tags.length
- };
- a.checkSrcChange = function () {
- for (var a = this.tags.length - 1, c = this.tags[a].src; a--;) this.tags[a].src = c
- };
- a.toString = function () {
- return "[HTMLAudioPlugin TagPool]"
- };
- createjs.HTMLAudioPlugin.TagPool = c
- })();
- (function (c) {
- c.hideAddressbar = function (a) {
- a = "string" === typeof a ? document.querySelector(a) : a;
- var b = navigator.userAgent,
- g = ~b.indexOf("iPhone") || ~b.indexOf("iPod"),
- f = ~b.indexOf("iPad"),
- d = g || f,
- e = ~b.indexOf("Android"),
- h = c.navigator.standalone,
- k = 0;
- (d || e) && a && (e && c.addEventListener("scroll", function () {
- a.style.height = c.innerHeight + "px"
- }, !1), function n() {
- var b = a.offsetWidth;
- k !== b && (k = b, b = 0, d ? (b = document.documentElement.clientHeight, g && !h && (b += 60)) : e && (b = c.innerHeight + 56), a.style.height = b + "px", setTimeout(scrollTo,
- 0, 0, 1), c.addEventListener("resize", n, !1), console.log("resizefunt"))
- }())
- }
- })(this);
- function isArrayContains(c, a) {
- return -1 < c.indexOf(a)
- }
- function addToArray(c, a) {
- isArrayContains(c, a) || c.push(a)
- }
- function removeFromArray(c, a) {
- isArrayContains(c, a) && c.splice(c.indexOf(a, 0), 1)
- }
- function setCacheFromOther(c, a) {
- c.cacheCanvas = a.cacheCanvas;
- c.cacheID = a.cacheID;
- c._cacheWidth = a._cacheWidth;
- c._cacheHeight = a._cacheHeight;
- c._cacheOffsetX = a._cacheOffsetX;
- c._cacheOffsetY = a._cacheOffsetY;
- c._cacheScale = a._cacheScale
- }
- function deleteCache(c) {
- c.cacheCanvas = null;
- c.cacheID = 0
- }
- function trace(c) {
- isLevelEditor && console.log(c)
- }
- function onHoverScale(c) {
- c.scaleX = c.scaleY = 1.2 * spriteScale * (c.defaultScale ? c.defaultScale : 1)
- }
- function onOutScale(c) {
- c.scaleX = c.scaleY = spriteScale * (c.defaultScale ? c.defaultScale : 1)
- }
- function removeFromParent(c) {
- c.parent && c.parent.removeChild(c)
- }
- function addToParent(c, a) {
- removeFromParent(c);
- a && a.addChild(c)
- }
- function setSpriteScale(c, a) {
- c.scaleX = c.scaleY = a
- }
- function setTextAndCenter(c, a, b, g) {
- g.text != b && (g.text = b, b = g.getBounds(), g.x = c - (b.width >> 1) * g.scaleX, a && (g.y = a - (b.height >> 1) * g.scaleY))
- }
- function setAnimationSpeed(c, a) {
- c._animation.speed = a
- }
- function setNextAnimation(c, a) {
- c._animation.next = a
- }
- function randomizeAnimFrame(c) {
- c.currentAnimationFrame = Math.floor(30 * Math.random())
- }
- var spilLogo, logoDefaultY = 0,
- logoDefaultX = 0,
- currentLogoHorizPos = 0,
- currentLogoVertPos = 0,
- LOGO_TOP_POS = 0,
- LOGO_BOTTOM_POS = 1,
- LOGO_VERTICAL_ANY_POS = 2,
- LOGO_LEFT_POS = 3,
- LOGO_RIGHT_POS = 4,
- LOGO_HORIZ_ANY_POS = 5,
- logoPosDivisor = 1,
- sponsorLogoFrame = "splashlogo";
- function createSponsorLogo() {
- spilLogo = createButton(160, 322, 0.8, sponsorLogoFrame, sponsorClick, null, null)
- }
- function showSponsorLogo(c, a, b, g, f, d, e, h) {
- spilLogo || createSponsorLogo();
- isSponsorLogoError || (addToParent(spilLogo, g), logoDefaultY = a, logoDefaultX = c, currentLogoHorizPos = d, currentLogoVertPos = e, spilLogo.scaleX = spilLogo.scaleY = b, spilLogo.alpha = f ? f : 1, logoPosDivisor = h, updateLogoPos(), (c = zoeSS.getAnimation(sponsorLogoFrame)) && c.frames && 0 < c.frames.length && (c = zoeSS.getFrameBounds(c.frames[0]), spilLogo.setBoundingBox(c.x * b, c.y * b, c.width * b, c.height * b)))
- }
- function updateLogoPos() {
- spilLogo && !isSponsorLogoError && (spilLogo.x = logoDefaultX, spilLogo.y = logoDefaultY, currentLogoHorizPos === LOGO_LEFT_POS ? spilLogo.x += deltaForHLeft() : currentLogoHorizPos === LOGO_RIGHT_POS && (spilLogo.x -= deltaForHLeft()), currentLogoVertPos === LOGO_TOP_POS ? spilLogo.y += deltaForVTop() / logoPosDivisor : currentLogoVertPos === LOGO_BOTTOM_POS && (spilLogo.y -= deltaForVTop() / logoPosDivisor))
- }
- var isAdPauseSoundMuted = !1;
- function startSponsorAds() {
- sponsorApi && (isAdPauseSoundMuted = isMute, sponsorApi.GameBreak.request(onAdBeginPause, onAdEndUnpause))
- }
- function onAdBeginPause() {
- trace("ad pause, , sound is muted: " + isMute);
- isAdPauseSoundMuted = isMute;
- isMute = !0;
- stopBgMusic();
- stopWindSound()
- }
- function onAdEndUnpause() {
- trace("ad unpause, sound was muted: " + isAdPauseSoundMuted);
- (isMute = isAdPauseSoundMuted) || playBgMusic()
- }
- function showTopLogo(c) {
- showSponsorLogo(160, 26, 0.7 * c, container, 1, LOGO_HORIZ_ANY_POS, LOGO_TOP_POS, 2)
- }
- function initSpilApi() {
- try {
- trace(GameAPI), GameAPI.loadAPI(function (a) {
- sponsorApi = a;
- logoConfig = sponsorApi.Branding.getLogo();
- showPreloaderLogo();
- isLogoReady = !0;
- trace(GameAPI.Branding.getLinks("more_games"));
- trace("list");
- trace(sponsorApi.Branding.getLogo())
- })
- } catch (c) {
- trace("init api fail!"), isSponsorLogoError = !0, isAllFilesLoaded && startGame()
- }
- }
- function handleFileLoadError(c) {
- trace("Logo loading error!");
- isSponsorLogoError = !0
- }
- var isSponsorLogoError = !1;
- function handleSponsorLogoComplete(c) {
- if (!isSponsorLogoError) try {
- spilLogo || createSponsorLogo();
- trace("logo loaded!");
- var a = files.sponsorLogoImg,
- b = sponsorLogoDefWidth = a.width,
- g = sponsorLogoDefHeight = a.height,
- f = sponsorLogoBitmap = (new createjs.Bitmap(a))
- .set({
- scaleX: 1,
- scaleY: 1,
- regX: 0,
- regY: 0,
- cursor: "pointer",
- x: 0,
- y: 0
- });
- f.isOnlyBoundsCheck = !0;
- f.setBoundingBox(0, 0, 1 * b, 1 * g);
- f.addEventListener("mousedown", sponsorClick);
- spilLogo.addChild(f);
- loaderBar && showSponsorLogo(160, 80, 1, loaderBar, 1, LOGO_HORIZ_ANY_POS,
- LOGO_VERTICAL_ANY_POS, 2);
- isLogoReady = !0
- } catch (d) {
- isSponsorLogoError = !0, trace("logo error!")
- }
- isAllFilesLoaded && startGame()
- }
- var logoConfig, sponsorLogoBitmap, sponsorPreload, sponsorLogoDefWidth = 1,
- sponsorLogoDefHeight = 1,
- sponsorApi, isLogoReady = !1,
- isGameInited = !1;
- (function (c, a) {
- function b() {
- function b() {
- var c;
- c = a("amd");
- c.fork = b;
- return c
- }
- return b()
- }
- function g() {
- function b() {
- var d, e = [],
- g = {};
- d = a("global");
- d.fork = b;
- d.noConflict = function () {
- var a, b;
- b = Array.prototype.slice.apply(arguments);
- for (a = 0; a < e.length; a += 1) "undefined" === typeof g[e[a]] ? delete c[e[a]] : c[e[a]] = g[e[a]];
- g = {};
- for (a = 0; a < b.length; a += 1) {
- if ("string" !== typeof b[a]) throw Error("Cannot replace namespaces. All new namespaces must be strings.");
- g[b[a]] = c[b[a]];
- c[b[a]] = d
- }
- return e = b
- };
- return d
- }
- b()
- .noConflict("KeyboardJS",
- "k")
- }[].indexOf || (Array.prototype.indexOf = function (a, b, c) {
- c = this.length;
- for (b = (c + ~~b) % c; b < c && (!(b in this) || this[b] !== a); b++);
- return b ^ c ? b : -1
- });
- "function" === typeof define && define.amd ? define(b) : g()
- })(this, function (c) {
- function a() {
- window.addEventListener ? (document.addEventListener("keydown", g, !1), document.addEventListener("keyup", f, !1), window.addEventListener("blur", b, !1), window.addEventListener("webkitfullscreenchange", b, !1), window.addEventListener("mozfullscreenchange", b, !1)) : window.attachEvent &&
- (document.attachEvent("onkeydown", g), document.attachEvent("onkeyup", f), window.attachEvent("onblur", b))
- }
- function b(a) {
- z = [];
- h();
- k(a)
- }
- function g(a) {
- var b, c;
- b = d(a.keyCode);
- if (!(1 > b.length)) {
- for (c = 0; c < b.length; c += 1) q(b[c]);
- for (b = 0; b < C.length; b += 1)
- if (c = r(C[b][0]), -1 === P.indexOf(C[b]) && n(c))
- for (P.push(C[b]), c = 0; c < C[b][1].length; c += 1) q(C[b][1][c]);
- var e, f, g, h, k, m, s = [];
- c = [].concat(z);
- for (b = 0; b < F.length; b += 1) e = p(F[b].keyCombo)
- .length, s[e] || (s[e] = []), s[e].push(F[b]);
- for (e = s.length - 1; 0 <= e; e -= 1)
- if (s[e])
- for (b =
- 0; b < s[e].length; b += 1) {
- f = s[e][b];
- g = p(f.keyCombo);
- m = !0;
- for (k = 0; k < g.length; k += 1)
- if (-1 === c.indexOf(g[k])) {
- m = !1;
- break
- }
- if (m && n(f.keyCombo)) {
- J.push(f);
- for (k = 0; k < g.length; k += 1) m = c.indexOf(g[k]), -1 < m && (c.splice(m, 1), k -= 1);
- for (g = 0; g < f.keyDownCallback.length; g += 1)!1 === f.keyDownCallback[g](a, t(), f.keyCombo) && (h = !0);
- !0 === h && (a.preventDefault(), a.stopPropagation())
- }
- }
- }
- }
- function f(a) {
- var b, c;
- b = d(a.keyCode);
- if (!(1 > b.length)) {
- for (c = 0; c < b.length; c += 1) w(b[c]);
- h();
- k(a)
- }
- }
- function d(a) {
- return y[a] || []
- }
- function e(a) {
- for (var b in y)
- if (y.hasOwnProperty(b) &&
- -1 < y[b].indexOf(a)) return b;
- return !1
- }
- function h() {
- var a, b;
- for (a = 0; a < P.length; a += 1)
- if (b = r(P[a][0]), !1 === n(b)) {
- for (b = 0; b < P[a][1].length; b += 1) w(P[a][1][b]);
- P.splice(a, 1);
- a -= 1
- }
- }
- function k(a) {
- var b, c, d, e;
- for (b = 0; b < J.length; b += 1)
- if (d = J[b], !1 === n(d.keyCombo)) {
- for (c = 0; c < d.keyUpCallback.length; c += 1)!1 === d.keyUpCallback[c](a, t(), d.keyCombo) && (e = !0);
- !0 === e && (a.preventDefault(), a.stopPropagation());
- J.splice(b, 1);
- b -= 1
- }
- }
- function m(a, b) {
- var c, d, e;
- a = r(a);
- b = r(b);
- if (a.length !== b.length) return !1;
- for (c = 0; c < a.length; c +=
- 1) {
- if (a[c].length !== b[c].length) return !1;
- for (d = 0; d < a[c].length; d += 1) {
- if (a[c][d].length !== b[c][d].length) return !1;
- for (e = 0; e < a[c][d].length; e += 1)
- if (-1 === b[c][d].indexOf(a[c][d][e])) return !1
- }
- }
- return !0
- }
- function n(a) {
- var b, c, d, e, f = 0,
- g, h;
- a = r(a);
- for (b = 0; b < a.length; b += 1) {
- h = !0;
- for (c = f = 0; c < a[b].length; c += 1) {
- d = [].concat(a[b][c]);
- for (e = f; e < z.length; e += 1) g = d.indexOf(z[e]), -1 < g && (d.splice(g, 1), f = e);
- if (0 !== d.length) {
- h = !1;
- break
- }
- }
- if (h) return !0
- }
- return !1
- }
- function p(a) {
- var b, c, d = [];
- a = r(a);
- for (b = 0; b < a.length; b += 1)
- for (c =
- 0; c < a[b].length; c += 1) d = d.concat(a[b][c]);
- return d
- }
- function r(a) {
- var b = 0,
- c = 0,
- d = !1,
- e = !1,
- f = [],
- g = [],
- h = [],
- k = "";
- if ("object" === typeof a && "function" === typeof a.push) return a;
- if ("string" !== typeof a) throw Error('Cannot parse "keyCombo" because its type is "' + typeof a + '". It must be a "string".');
- for (;
- " " === a.charAt(b);) b += 1;
- for (;;) {
- if (" " === a.charAt(b)) {
- for (;
- " " === a.charAt(b);) b += 1;
- d = !0
- } else if ("," === a.charAt(b)) {
- if (c || e) throw Error("Failed to parse key combo. Unexpected , at character index " + b + ".");
- e = !0;
- b += 1
- } else if ("+" === a.charAt(b)) {
- k.length && (h.push(k), k = "");
- if (c || e) throw Error("Failed to parse key combo. Unexpected + at character index " + b + ".");
- c = !0;
- b += 1
- } else if (">" === a.charAt(b)) {
- k.length && (h.push(k), k = "");
- h.length && (g.push(h), h = []);
- if (c || e) throw Error("Failed to parse key combo. Unexpected > at character index " + b + ".");
- c = !0;
- b += 1
- } else if (b < a.length - 1 && "!" === a.charAt(b) && (">" === a.charAt(b + 1) || "," === a.charAt(b + 1) || "+" === a.charAt(b + 1))) k += a.charAt(b + 1), e = d = c = !1, b += 2;
- else if (b < a.length && "+" !== a.charAt(b) &&
- ">" !== a.charAt(b) && "," !== a.charAt(b) && " " !== a.charAt(b)) {
- if (!1 === c && !0 === d || !0 === e) k.length && (h.push(k), k = ""), h.length && (g.push(h), h = []), g.length && (f.push(g), g = []);
- for (e = d = c = !1; b < a.length && "+" !== a.charAt(b) && ">" !== a.charAt(b) && "," !== a.charAt(b) && " " !== a.charAt(b);) k += a.charAt(b), b += 1
- } else {
- b += 1;
- continue
- } if (b >= a.length) {
- k.length && h.push(k);
- h.length && g.push(h);
- g.length && f.push(g);
- break
- }
- }
- return f
- }
- function s(a) {
- var b, c, d = [];
- if ("string" === typeof a) return a;
- if ("object" !== typeof a || "function" !== typeof a.push) throw Error("Cannot stringify key combo.");
- for (b = 0; b < a.length; b += 1) {
- d[b] = [];
- for (c = 0; c < a[b].length; c += 1) d[b][c] = a[b][c].join(" + ");
- d[b] = d[b].join(" > ")
- }
- return d.join(" ")
- }
- function t(a) {
- return [].concat(z)
- }
- function q(a) {
- if (a.match(/\s/)) throw Error("Cannot add key name " + a + " to active keys because it contains whitespace."); - 1 < z.indexOf(a) || z.push(a)
- }
- function w(a) {
- var b = e(a);
- "91" === b || "92" === b ? z = [] : z.splice(z.indexOf(a), 1)
- }
- function u(a, b) {
- if ("string" !== typeof a) throw Error("Cannot register new locale. The locale name must be a string.");
- if ("object" !==
- typeof b) throw Error("Cannot register " + a + " locale. The locale map must be an object.");
- if ("object" !== typeof b.map) throw Error("Cannot register " + a + " locale. The locale map is invalid.");
- b.macros || (b.macros = []);
- K[a] = b
- }
- function x(a) {
- if (a) {
- if ("string" !== typeof a) throw Error("Cannot set locale. The locale name must be a string.");
- if (!K[a]) throw Error("Cannot set locale to " + a + " because it does not exist. If you would like to submit a " + a + " locale map for KeyboardJS please submit it at https://github.com/RobertWHurst/KeyboardJS/issues.");
- y = K[a].map;
- C = K[a].macros;
- A = a
- }
- return A
- }
- c = {};
- var K = {},
- A, y, C, z = [],
- F = [],
- J = [],
- P = [],
- E, S;
- S = {
- map: {
- 3: ["cancel"],
- 8: ["backspace"],
- 9: ["tab"],
- 12: ["clear"],
- 13: ["enter"],
- 16: ["shift"],
- 17: ["ctrl"],
- 18: ["alt", "menu"],
- 19: ["pause", "break"],
- 20: ["capslock"],
- 27: ["escape", "esc"],
- 32: ["space", "spacebar"],
- 33: ["pageup"],
- 34: ["pagedown"],
- 35: ["end"],
- 36: ["home"],
- 37: ["left"],
- 38: ["up"],
- 39: ["right"],
- 40: ["down"],
- 41: ["select"],
- 42: ["printscreen"],
- 43: ["execute"],
- 44: ["snapshot"],
- 45: ["insert", "ins"],
- 46: ["delete", "del"],
- 47: ["help"],
- 91: "command windows win super leftcommand leftwindows leftwin leftsuper".split(" "),
- 92: "command windows win super rightcommand rightwindows rightwin rightsuper".split(" "),
- 145: ["scrolllock", "scroll"],
- 186: ["semicolon", ";"],
- 187: ["equal", "equalsign", "="],
- 188: ["comma", ","],
- 189: ["dash", "-"],
- 190: ["period", "."],
- 191: ["slash", "forwardslash", "/"],
- 192: ["graveaccent", "`"],
- 219: ["openbracket", "["],
- 220: ["backslash", "\\"],
- 221: ["closebracket", "]"],
- 222: ["apostrophe", "'"],
- 48: ["zero", "0"],
- 49: ["one", "1"],
- 50: ["two", "2"],
- 51: ["three", "3"],
- 52: ["four", "4"],
- 53: ["five", "5"],
- 54: ["six", "6"],
- 55: ["seven", "7"],
- 56: ["eight", "8"],
- 57: ["nine", "9"],
- 96: ["numzero", "num0"],
- 97: ["numone", "num1"],
- 98: ["numtwo", "num2"],
- 99: ["numthree", "num3"],
- 100: ["numfour", "num4"],
- 101: ["numfive", "num5"],
- 102: ["numsix", "num6"],
- 103: ["numseven", "num7"],
- 104: ["numeight", "num8"],
- 105: ["numnine", "num9"],
- 106: ["nummultiply", "num*"],
- 107: ["numadd", "num+"],
- 108: ["numenter"],
- 109: ["numsubtract", "num-"],
- 110: ["numdecimal", "num."],
- 111: ["numdevide", "num/"],
- 144: ["numlock", "num"],
- 112: ["f1"],
- 113: ["f2"],
- 114: ["f3"],
- 115: ["f4"],
- 116: ["f5"],
- 117: ["f6"],
- 118: ["f7"],
- 119: ["f8"],
- 120: ["f9"],
- 121: ["f10"],
- 122: ["f11"],
- 123: ["f12"]
- },
- macros: [
- ["shift + `", ["tilde", "~"]],
- ["shift + 1", ["exclamation", "exclamationpoint", "!"]],
- ["shift + 2", ["at", "@"]],
- ["shift + 3", ["number", "#"]],
- ["shift + 4", ["dollar", "dollars", "dollarsign", "$"]],
- ["shift + 5", ["percent", "%"]],
- ["shift + 6", ["caret", "^"]],
- ["shift + 7", ["ampersand", "and", "&"]],
- ["shift + 8", ["asterisk", "*"]],
- ["shift + 9", ["openparen", "("]],
- ["shift + 0", ["closeparen", ")"]],
- ["shift + -", ["underscore", "_"]],
- ["shift + =", ["plus", "+"]],
- ["shift + (", ["opencurlybrace", "opencurlybracket", "{"]],
- ["shift + )", ["closecurlybrace", "closecurlybracket", "}"]],
- ["shift + \\", ["verticalbar", "|"]],
- ["shift + ;", ["colon", ":"]],
- ["shift + '", ["quotationmark", '"']],
- ["shift + !,", ["openanglebracket", "<"]],
- ["shift + .", ["closeanglebracket", ">"]],
- ["shift + /", ["questionmark", "?"]]
- ]
- };
- for (E = 65; 90 >= E; E += 1) S.map[E] = String.fromCharCode(E + 32), S.macros.push(["shift + " + String.fromCharCode(E + 32) + ", capslock + " + String.fromCharCode(E + 32), [String.fromCharCode(E)]]);
- u("us", S);
- x("us");
- a();
- c.enable = a;
- c.disable = function () {
- b();
- window.removeEventListener ? (document.removeEventListener("keydown", g, !1), document.removeEventListener("keyup", f, !1), window.removeEventListener("blur", b, !1), window.removeEventListener("webkitfullscreenchange", b, !1), window.removeEventListener("mozfullscreenchange", b, !1)) : window.detachEvent && (document.detachEvent("onkeydown", g), document.detachEvent("onkeyup", f), window.detachEvent("onblur", b))
- };
- c.activeKeys = t;
- c.isPressed = function (a) {
- return -1 < z.indexOf(a)
- };
- c.on = function (a, b, c) {
- var d = {},
- e, f = [],
- g, h;
- "string" === typeof a && (a = r(a));
- for (g = 0; g < a.length; g += 1) {
- e = {};
- h = s([a[g]]);
- if ("string" !== typeof h) throw Error("Failed to bind key combo. The key combo must be string.");
- e.keyCombo = h;
- e.keyDownCallback = [];
- e.keyUpCallback = [];
- b && e.keyDownCallback.push(b);
- c && e.keyUpCallback.push(c);
- F.push(e);
- f.push(e)
- }
- d.clear = function () {
- var a;
- for (a = 0; a < f.length; a += 1) F.splice(F.indexOf(f[a]), 1)
- };
- d.on = function (a) {
- var b = {},
- c, d, e;
- if ("string" !== typeof a) throw Error("Cannot bind callback. The event name must be a string.");
- if ("keyup" !== a && "keydown" !== a) throw Error('Cannot bind callback. The event name must be a "keyup" or "keydown".');
- c = Array.prototype.slice.apply(arguments, [1]);
- for (d = 0; d < c.length; d += 1)
- if ("function" === typeof c[d])
- if ("keyup" === a)
- for (e = 0; e < f.length; e += 1) f[e].keyUpCallback.push(c[d]);
- else if ("keydown" === a)
- for (e = 0; e < f.length; e += 1) f[e].keyDownCallback.push(c[d]);
- b.clear = function () {
- var b, d;
- for (b = 0; b < c.length; b += 1)
- if ("function" === typeof c[b])
- if ("keyup" === a)
- for (d = 0; d < f.length; d += 1) f[d].keyUpCallback.splice(f[d].keyUpCallback.indexOf(c[b]),
- 1);
- else
- for (d = 0; d < f.length; d += 1) f[d].keyDownCallback.splice(f[d].keyDownCallback.indexOf(c[b]), 1)
- };
- return b
- };
- return d
- };
- c.clear = function (a) {
- var b, c;
- for (b = 0; b < F.length; b += 1) c = F[b], m(a, c.keyCombo) && (F.splice(b, 1), b -= 1)
- };
- c.clear.key = function (a) {
- var b, c, d;
- if (a)
- for (b = 0; b < F.length; b += 1)
- for (d = F[b], c = 0; c < d.keyCombo.length; c += 1) {
- if (-1 < d.keyCombo[c].indexOf(a)) {
- F.splice(b, 1);
- b -= 1;
- break
- }
- } else F = []
- };
- c.locale = x;
- c.locale.register = u;
- c.macro = function (a, b) {
- if ("string" !== typeof a && ("object" !== typeof a || "function" !==
- typeof a.push)) throw Error("Cannot create macro. The combo must be a string or array.");
- if ("object" !== typeof b || "function" !== typeof b.push) throw Error("Cannot create macro. The injectedKeys must be an array.");
- C.push([a, b])
- };
- c.macro.remove = function (a) {
- var b;
- if ("string" !== typeof a && ("object" !== typeof a || "function" !== typeof a.push)) throw Error("Cannot remove macro. The combo must be a string or array.");
- for (mI = 0; mI < C.length; mI += 1)
- if (b = C[mI], m(a, b[0])) {
- w(b[1]);
- C.splice(mI, 1);
- break
- }
- };
- c.key = {};
- c.key.name =
- d;
- c.key.code = e;
- c.combo = {};
- c.combo.active = n;
- c.combo.parse = r;
- c.combo.stringify = s;
- return c
- });
- var allLevels = [
- [
- ["DECOR_HELP_1_TYPE", 182, 216.25, 0.6, 0.6, 0, [""]],
- ["LAND_TYPE", 94.5, 270.95, 0.84, 0.84, 8, [""]],
- ["LAND_TYPE", 229.5, 314.25, 0.84, 0.84, 0, ["4"]],
- ["HERO_TYPE", 92.35, 224.75, 0.68, 0.68, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 123.6, 240, 0.423, 0.423, 7, [""]],
- ["AIM_TYPE", 257.9, 265.4, 0.74, 0.74, 0, ["REV"]]
- ],
- [
- ["LAND_TYPE", 63.7, 249, 0.84, 0.84, 0, ["2"]],
- ["LAND_TYPE", 227.05, 277.7, 0.84, 0.84, 0, [""]],
- ["HERO_TYPE", 226.8, 126.4, 0.68, 0.68, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 200.3, 244.75, 0.423, 0.423, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 251.15,
- 244.75, 0.423, 0.423, 0, [""]
- ],
- ["DYNAMIC_RECT_TYPE", 225.85, 188.05, 0.7, 0.7, 0, [""]],
- ["DYNAMIC_RECT_TYPE", 225.75, 225.45, 0.7, 0.7, 0, ["2"]],
- ["DYNAMIC_BOX_TYPE", 251.25, 207, 0.42, 0.42, 0, ["2"]],
- ["DYNAMIC_BOX_TYPE", 199.55, 207, 0.42, 0.42, 0, ["3"]],
- ["DYNAMIC_TRIANGLE_TYPE", 243.55, 165, 0.7, 0.7, 180, [""]],
- ["DYNAMIC_TRIANGLE_TYPE", 225.3, 163, 0.68, 0.68, 0, [""]],
- ["DYNAMIC_TRIANGLE_TYPE", 207.85, 165, 0.69, 0.69, 180, [""]],
- ["STATIC_BALK_1_TYPE", 149.7, 207.5, 0.6, 0.6, -25, [""]],
- ["AIM_TYPE", 42.05, 199.7, 0.74, 0.74, 0, ["DEF"]]
- ],
- [
- ["LAND_TYPE",
- 116.95, 287.15, 0.84, 0.84, 0, ["2"]
- ],
- ["LAND_TYPE", 40.05, 192.4, 0.84, 0.84, 0, [""]],
- ["HERO_TYPE", 47.8, 107, 0.68, 0.68, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 21.3, 157, 0.43, 0.43, 0, [""]],
- ["DYNAMIC_RECT_TYPE", 46.75, 136.15, 0.7, 0.7, 0, ["2"]],
- ["DYNAMIC_RECT_TYPE", 127.2, 146.75, 0.7, 0.7, 90, [""]],
- ["DYNAMIC_RECT_TYPE", 127.2, 223.8, 0.7, 0.7, 90, [""]],
- ["DYNAMIC_BOX_TYPE", 73.55, 157, 0.43, 0.43, 0, [""]],
- ["BONUS_STAR_TYPE", 185.3, 210.2, 0.798, 0.798, 0, [""]],
- ["AIM_TYPE", 272.2, 287.95, 0.74, 0.74, 0, ["REV_MOVED_R_0_4"]]
- ],
- [
- ["LAND_TYPE", 274, 233.45, 0.84,
- 0.84, -8, ["5"]
- ],
- ["LAND_TYPE", 158.75, 240.9, 0.84, 0.84, 0, ["2"]],
- ["LAND_TYPE", 46.15, 240.9, 0.84, 0.84, 0, ["2"]],
- ["STATIC_BOX_TYPE", 327.7, 166.45, 0.5, 1.06, -23, ["INVIS"]],
- ["DECOR_HELP_2_TYPE", 91.45, 114.4, 0.7, 0.7, 0, [""]],
- ["BOMB_TYPE", 45.55, 195.25, 0.9, 0.9, 0, ["180_700"]],
- ["HERO_TYPE", 128.2, 192.1, 0.68, 0.68, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 11.8, 204.8, 0.43, 0.43, 0, [""]],
- ["BONUS_STAR_TYPE", 211.2, 192.05, 0.798, 0.798, 0, [""]],
- ["AIM_TYPE", 298.65, 182.25, 0.74, 0.74, -8, ["REV"]]
- ],
- [
- ["LAND_TYPE", 161.7, 361.4, 0.84, 0.84, 0, ["5"]],
- ["LAND_TYPE",
- 263.85, 237.95, 0.84, 0.84, 0, [""]
- ],
- ["DYNAMIC_BOX_TYPE", 237.1, 205, 0.423, 0.423, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 287.95, 205, 0.423, 0.423, 0, [""]],
- ["DYNAMIC_RECT_TYPE", 262.65, 148.3, 0.7, 0.7, 0, [""]],
- ["DYNAMIC_RECT_TYPE", 262.55, 185.7, 0.7, 0.7, 0, ["2"]],
- ["DYNAMIC_BOX_TYPE", 288.05, 167.25, 0.42, 0.42, 0, ["2"]],
- ["DYNAMIC_BOX_TYPE", 236.35, 167.25, 0.42, 0.42, 0, ["3"]],
- ["STATIC_BALK_1_TYPE", 157.5, 139.5, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 164.5, 221.05, 0.7, 0.7, 0, [""]],
- ["MOVABLE_BALK_TYPE", 64, 281.45, 1.03, 0.699, 35, ["R_1030_5"]],
- ["HERO_TYPE",
- 261.65, 115.4, 0.68, 0.68, 0, [""]
- ],
- ["BONUS_STAR_TYPE", 163.6, 184, 0.798, 0.798, 0, [""]],
- ["BONUS_STAR_TYPE", 89.95, 253.4, 0.798, 0.798, 0, [""]],
- ["AIM_TYPE", 193.1, 314, 0.74, 0.74, 0, ["REV"]]
- ],
- [
- ["TELEPORT_TYPE", 241.7, 69.45, 1, 1, 0, ["A"]],
- ["TELEPORT_TYPE", 121.55, 367.3, 1, 1, 0, ["A"]],
- ["LAND_TYPE", 219.85, 392.45, 0.84, 0.84, -6, ["2"]],
- ["LAND_TYPE", 68.25, 150.95, 0.84, 0.84, 0, ["3"]],
- ["LAND_TYPE", 62.05, 295.65, 0.84, 0.84, 0, [""]],
- ["HERO_TYPE", 61.8, 218.15, 0.68, 0.68, 0, [""]],
- ["DYNAMIC_TRIANGLE_TYPE", 78.55, 256.75, 0.7, 0.7, 180, [""]],
- ["DYNAMIC_TRIANGLE_TYPE",
- 60.3, 254.75, 0.68, 0.68, 0, [""]
- ],
- ["DYNAMIC_TRIANGLE_TYPE", 42.85, 256.75, 0.69, 0.69, 180, [""]],
- ["STATIC_BALK_1_TYPE", 157.05, 290.2, 0.7, 0.7, 12, [""]],
- ["STATIC_BALK_1_TYPE", 294.05, 261.85, 0.7, 0.7, 68, [""]],
- ["STATIC_BALK_1_TYPE", 290.7, 333.7, 0.7, 0.7, 118, [""]],
- ["BONUS_STAR_TYPE", 158.25, 250.7, 0.798, 0.798, 0, [""]],
- ["BONUS_STAR_TYPE", 238.25, 337.7, 0.798, 0.798, 0, [""]],
- ["BONUS_STAR_TYPE", 158.25, 91.2, 0.798, 0.798, 0, [""]],
- ["STATIC_BALK_1_TYPE", 164.1, 125.8, 0.7, 0.7, 171, [""]],
- ["STATIC_BALK_1_TYPE", 244.15, 112.65, 0.7, 0.7, 171, [""]],
- ["AIM_TYPE", 43.45, 103.6, 0.73, 0.73, 0, ["DEF"]]
- ],
- [
- ["LAND_TYPE", 71, 387.8, 0.84, 0.84, 0, [""]],
- ["DECOR_HELP_3_TYPE", 163.85, 193.45, 0.67, 0.67, 0, [""]],
- ["STATIC_BALK_1_TYPE", 61.35, 153.35, 0.791, 0.814, 0, [""]],
- ["DYNAMIC_RECT_TYPE", 161.15, 130.25, 1.31, 1.278, 0, [""]],
- ["HARD_RECT_TYPE", 162.35, 107.6, 0.92, 1, 0, [""]],
- ["STATIC_BALK_1_TYPE", 262.85, 153.35, 0.791, 0.814, 0, [""]],
- ["STATIC_BALK_1_TYPE", 236.85, 369.7, 0.791, 0.814, 0, [""]],
- ["STATIC_BALK_1_TYPE", 272.5, 262.7, 0.791, 0.814, -11, [""]],
- ["DYNAMIC_TRIANGLE_TYPE", 243.3, 243.65, 0.68,
- 0.68, 170, [""]
- ],
- ["BONUS_STAR_TYPE", 130.05, 325.55, 0.68, 0.68, 0, [""]],
- ["BONUS_STAR_TYPE", 188.65, 273, 0.68, 0.68, 0, [""]],
- ["HERO_TYPE", 271.95, 230.1, 0.68, 0.68, 0, [""]],
- ["AIM_TYPE", 46.2, 339.5, 0.73, 0.73, 0, ["DEF"]]
- ],
- [
- ["TELEPORT_TYPE", 211.9, 186.85, 1, 1, 0, ["A"]],
- ["TELEPORT_TYPE", 53.9, 377.5, 1, 1, 0, ["A"]],
- ["LAND_TYPE", 185, 266.4, 0.989, 0.84, 0, ["5"]],
- ["HARD_RECT_TYPE", 76.45, 230.35, 1, 1, 0, [""]],
- ["STATIC_BOX_TYPE", 33.85, 252.85, 0.75, 0.75, 0, [""]],
- ["STATIC_BOX_TYPE", 72.85, 298.95, 0.75, 0.75, 0, [""]],
- ["BOMB_TYPE", 73.9, 270.2, 0.8,
- 0.8, 0, ["140_600"]
- ],
- ["STATIC_BOX_TYPE", 46.85, 119.3, 0.75, 0.75, 0, [""]],
- ["STATIC_BOX_TYPE", 133.35, 119.8, 0.75, 0.75, 0, [""]],
- ["HARD_RECT_TYPE", 89.85, 97.3, 1, 1, 0, [""]],
- ["HARD_RECT_TYPE", 72.5, 163.25, 1, 1, 90, [""]],
- ["STATIC_BALK_1_TYPE", 182.95, 128.9, 0.7, 0.7, 15, [""]],
- ["STATIC_BALK_1_TYPE", 128.45, 405.8, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 204.45, 405.8, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 277.45, 386.8, 0.7, 0.7, -30, [""]],
- ["DYNAMIC_TRIANGLE_TYPE", 235.45, 233.1, 0.68, 0.68, -60, [""]],
- ["STATIC_BALK_1_TYPE", 312.3, 151.15,
- 0.7, 0.7, -90, [""]
- ],
- ["HERO_TYPE", 118.95, 64.4, 0.68, 0.68, 0, [""]],
- ["BONUS_STAR_TYPE", 267.85, 119, 0.68, 0.68, 0, [""]],
- ["BONUS_STAR_TYPE", 203.85, 358.05, 0.68, 0.68, 0, [""]],
- ["AIM_TYPE", 156.15, 217.55, 0.73, 0.73, 0, ["DEF"]]
- ],
- [
- ["LAND_TYPE", 238.5, 404.05, 0.84, 0.84, 0, ["2"]],
- ["LAND_TYPE", 131.15, 140.05, 0.84, 0.84, 0, ["4"]],
- ["LAND_TYPE", 46.5, 249.6, 0.84, 0.84, 8, [""]],
- ["HERO_TYPE", 44.35, 203.4, 0.68, 0.68, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 75.6, 218.65, 0.423, 0.423, 7, [""]],
- ["TELEGA_TYPE", 199.05, 302.45, 1.68, 0.85, 0, ["1_R_50_8"]],
- ["BOMB_TYPE",
- 240.2, 358.8, 0.9, 0.9, 0, ["180_1400"]
- ],
- ["BONUS_STAR_TYPE", 248.2, 195.3, 0.798, 0.798, 0, [""]],
- ["BONUS_STAR_TYPE", 240.3, 117.65, 0.798, 0.798, 0, [""]],
- ["STATIC_BALK_1_TYPE", 276.2, 127.65, 0.7, 0.7, 68, [""]],
- ["STATIC_BALK_1_TYPE", 229.65, 67.3, 0.7, 0.7, 36, [""]],
- ["STATIC_BALK_1_TYPE", 168, 52.1, 0.48, 0.48, -15, [""]],
- ["BONUS_STAR_TYPE", 150.4, 240, 0.798, 0.798, 0, [""]],
- ["AIM_TYPE", 107.8, 90, 0.73, 0.73, 0, ["DEF"]]
- ],
- [
- ["LAND_TYPE", 259.95, 376.75, 0.84, 0.84, 0, [""]],
- ["LAND_TYPE", 76, 144.8, 0.84, 0.84, 0, [""]],
- ["DECOR_HELP_4_TYPE", 168.25, 78.95,
- 0.59, 0.59, 0, [""]
- ],
- ["STATIC_BALK_1_TYPE", 168.25, 138.6, 0.7, 0.7, 15, [""]],
- ["STATIC_BALK_1_TYPE", 93.4, 327.3, 0.7, 0.7, 15, [""]],
- ["STATIC_BALK_1_TYPE", 167.35, 348.3, 0.7, 0.7, 15, [""]],
- ["HERO_TYPE", 95, 95.3, 0.68, 0.68, 0, [""]],
- ["FAN_TYPE", 44, 93.85, 0.8, 0.8, 0, ["DEF_60_40"]],
- ["BONUS_STAR_TYPE", 263.4, 188.55, 0.68, 0.68, 0, [""]],
- ["BONUS_STAR_TYPE", 98.9, 277.7, 0.68, 0.68, 0, [""]],
- ["STATIC_BALK_1_TYPE", 270.95, 228.2, 0.7, 0.7, -15, [""]],
- ["STATIC_BALK_1_TYPE", 197.95, 247.6, 0.7, 0.7, -15, [""]],
- ["STATIC_BALK_1_TYPE", 20.4, 306.3, 0.7, 0.7,
- 15, [""]
- ],
- ["STATIC_BALK_1_TYPE", 342.95, 208.2, 0.7, 0.7, -15, [""]],
- ["BONUS_STAR_TYPE", 175.4, 218.95, 0.68, 0.68, 0, [""]],
- ["BONUS_STAR_TYPE", 176.4, 307.15, 0.68, 0.68, 0, [""]],
- ["BONUS_STAR_TYPE", 234.35, 124.45, 0.68, 0.68, 0, [""]],
- ["AIM_TYPE", 278.35, 327.55, 0.74, 0.74, 0, ["REV"]]
- ],
- [
- ["LAND_TYPE", 52, 194.5, 0.84, 0.84, 0, ["2"]],
- ["LAND_TYPE", 51.9, 367.85, 0.84, 0.84, 0, ["5"]],
- ["DYNAMIC_RECT_TYPE", 149.9, 350.05, 0.751, 0.819, 0, [""]],
- ["DYNAMIC_TRIANGLE_TYPE", 214.2, 132, 0.822, 0.76, 180, [""]],
- ["DYNAMIC_TRIANGLE_TYPE", 192.5, 130.1, 0.81, 0.749,
- 0, [""]
- ],
- ["DYNAMIC_TRIANGLE_TYPE", 171.7, 131.75, 0.822, 0.76, 180, [""]],
- ["STATIC_BALK_1_TYPE", 232, 333.65, 0.749, 0.767, -22, [""]],
- ["BONUS_STAR_TYPE", 105.4, 119.65, 0.68, 0.68, 0, [""]],
- ["STATIC_BALK_1_TYPE", 193.85, 156.85, 0.875, 0.825, 0, [""]],
- ["FAN_TYPE", 27.4, 147.1, 0.8, 0.8, 0, ["DEF_130_40"]],
- ["STATIC_BALK_1_TYPE", 297, 287.2, 0.749, 0.767, -52, [""]],
- ["STATIC_BALK_1_TYPE", 302, 119.1, 0.921, 0.877, -105, [""]],
- ["BONUS_STAR_TYPE", 282, 215.35, 0.68, 0.68, 0, [""]],
- ["STATIC_BOX_TYPE", 194.8, 368.1, 0.616, 0.615, 0, [""]],
- ["STATIC_BALK_1_TYPE",
- 129.8, 394.3, 0.743, 0.787, 53, [""]
- ],
- ["STATIC_BOX_TYPE", 174.05, 440, 0.75, 0.75, 0, [""]],
- ["FAN_TYPE", 189.95, 416.55, 0.8, 0.8, 45, ["REV_630_10"]],
- ["BONUS_STAR_TYPE", 158.35, 383.05, 0.68, 0.68, 0, [""]],
- ["STATIC_BOX_TYPE", 120.2, 168, 0.616, 0.615, -22, [""]],
- ["STATIC_BOX_TYPE", 136.85, 161.1, 0.616, 0.615, -22, [""]],
- ["STATIC_BOX_TYPE", -1.3, 308.05, 0.5, 1.06, 14, ["INVIS"]],
- ["HERO_TYPE", 192.65, 91.05, 0.68, 0.68, 0, [""]],
- ["AIM_TYPE", 29.2, 319.75, 0.73, 0.73, 0, ["DEF"]]
- ],
- [
- ["LAND_TYPE", 289.4, 407.6, 0.84, 0.84, 6, ["3"]],
- ["LAND_TYPE", 249.5, 144.1,
- 0.84, 0.84, 0, ["3"]
- ],
- ["LAND_TYPE", 180.4, 395.45, 0.84, 0.84, 6, ["3"]],
- ["HERO_TYPE", 248.5, 60.05, 0.68, 0.68, 0, [""]],
- ["BONUS_STAR_TYPE", 294.85, 201.95, 0.65, 0.65, 0, [""]],
- ["BONUS_STAR_TYPE", 53.65, 173.65, 0.65, 0.65, 0, [""]],
- ["BONUS_STAR_TYPE", 180.55, 345.15, 0.65, 0.65, 0, [""]],
- ["DYNAMIC_RECT_TYPE", 248.2, 91.15, 0.7, 0.7, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 273.6, 110.1, 0.42, 0.42, 0, ["2"]],
- ["DYNAMIC_BOX_TYPE", 221.9, 110.1, 0.42, 0.42, 0, ["3"]],
- ["TELEGA_TYPE", 158.65, 242.3, 2.2, 0.85, 0, ["2_R_0_10"]],
- ["AIM_TYPE", 303.1, 360.05, 0.74, 0.74, 6, ["REV"]]
- ],
- [
- ["LAND_TYPE", 236, 242.95, 0.99, 0.84, 0, ["4"]],
- ["LAND_TYPE", 59.9, 405.7, 0.84, 0.84, 0, ["5"]],
- ["TELEPORT_TYPE", 199.85, 141.9, 1, 1, 0, ["A"]],
- ["TELEPORT_TYPE", 274.3, 384.95, 1, 1, 0, ["A"]],
- ["STATIC_BOX_TYPE", 233.9, 205.65, 0.75, 0.75, 0, [""]],
- ["STATIC_BALK_1_TYPE", 41.95, 99.95, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 116.9, 99.95, 0.7, 0.7, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 22.95, 368.7, 0.42, 0.42, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 93.95, 368.7, 0.42, 0.42, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 93.95, 346.7, 0.42, 0.42, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 22.95, 347.7,
- 0.42, 0.42, 0, [""]
- ],
- ["DYNAMIC_RECT_TYPE", 58.9, 326, 0.924, 0.79, 0, [""]],
- ["STATIC_BALK_1_TYPE", 220.95, 430.95, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 295.9, 430.95, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 149.55, 412.95, 0.7, 0.7, 30, [""]],
- ["STATIC_BALK_1_TYPE", 292.85, 101.15, 0.7, 0.7, -90, [""]],
- ["STATIC_BALK_1_TYPE", 292.85, 177.15, 0.7, 0.7, -90, [""]],
- ["STATIC_BALK_1_TYPE", 190.85, 99.95, 0.7, 0.7, 0, [""]],
- ["BOMB_TYPE", 60.4, 73.15, 0.8, 0.8, 0, ["140_700"]],
- ["BOMB_TYPE", 178.35, 73.15, 0.8, 0.8, 0, ["140_700"]],
- ["HERO_TYPE", 57.2, 293.45,
- 0.68, 0.68, 0, [""]
- ],
- ["BONUS_STAR_TYPE", 173.95, 380.55, 0.68, 0.68, 0, [""]],
- ["BONUS_STAR_TYPE", 161.85, 188.35, 0.68, 0.68, 0, [""]],
- ["AIM_TYPE", 48.25, 189.95, 0.832, 0.888, 0, ["DEF_MOVED_R_0_10"]]
- ],
- [
- ["LAND_TYPE", 69.8, 135.2, 0.84, 0.84, 0, ["5"]],
- ["STATIC_BALK_1_TYPE", 164.85, 128.85, 0.7, 0.7, 15, [""]],
- ["STATIC_BALK_1_TYPE", 206.8, 238.9, 0.7, 0.7, -15, [""]],
- ["STATIC_BALK_1_TYPE", 279.25, 219.45, 0.7, 0.7, -15, [""]],
- ["STATIC_BALK_1_TYPE", 133.8, 257.9, 0.7, 0.7, -15, [""]],
- ["STATIC_BALK_1_TYPE", 38.8, 345.85, 0.7, 0.7, 15, [""]],
- ["STATIC_BALK_1_TYPE",
- 110.8, 365.8, 0.7, 0.7, 15, [""]
- ],
- ["BONUS_STAR_TYPE", 53.75, 291.15, 0.68, 0.68, 0, [""]],
- ["STATIC_BALK_1_TYPE", 310.35, 162.35, 0.7, 0.7, -90, [""]],
- ["BONUS_STAR_TYPE", 262.8, 167.15, 0.68, 0.68, 0, [""]],
- ["STATIC_BALK_1_TYPE", 10.4, 289.05, 0.7, 0.7, -90, [""]],
- ["FAN_TYPE", 37.75, 85.6, 0.8, 0.8, 0, ["DEF_100_40"]],
- ["HERO_TYPE", 115, 87.9, 0.68, 0.68, 0, [""]],
- ["AIM_TYPE", 266.25, 362, 1.185, 0.74, 0, ["REV_MOVED_R_0_10"]]
- ],
- [
- ["LAND_TYPE", 53, 391.05, 0.84, 0.84, 0, [""]],
- ["STATIC_BOX_TYPE", 280.4, 58.75, 0.592, 0.516, 20, [""]],
- ["STATIC_BALK_1_TYPE", 310.6,
- 143.15, 0.7, 0.7, -90, [""]
- ],
- ["FAN_TYPE", 302.45, 86.1, 0.8, 0.8, -15, ["REV_530_10"]],
- ["STATIC_BOX_TYPE", 264.9, 52.75, 0.592, 0.516, 20, [""]],
- ["STATIC_BALK_1_TYPE", 141.75, 374.65, 0.599, 0.631, 0, [""]],
- ["STATIC_BALK_1_TYPE", 206.95, 383.65, 0.603, 0.627, 16, [""]],
- ["STATIC_BALK_1_TYPE", 270, 402.65, 0.603, 0.627, 16, [""]],
- ["STATIC_BALK_1_TYPE", 56.65, 49.75, 0.734, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 136.5, 49.75, 0.734, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 216.4, 49.75, 0.734, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 9.2, 82.75, 0.742, 0.7, -90, [""]],
- ["STATIC_BALK_1_TYPE", 9.2, 163.35, 0.742, 0.7, -90, [""]],
- ["STATIC_BALK_1_TYPE", 310.6, 219.15, 0.7, 0.7, -90, [""]],
- ["STATIC_BALK_1_TYPE", 310.6, 294.15, 0.7, 0.7, -90, [""]],
- ["STATIC_BALK_1_TYPE", 310.6, 370.15, 0.7, 0.7, -90, [""]],
- ["STATIC_BALK_1_TYPE", 9.2, 242.75, 0.742, 0.7, -90, [""]],
- ["STATIC_BALK_1_TYPE", 9.2, 323.25, 0.742, 0.7, -90, [""]],
- ["BOMB_TYPE", 284.7, 380.25, 0.8, 0.8, 0, ["140_300"]],
- ["STATIC_BALK_1_TYPE", 247.15, 199.7, 0.725, 0.7, -90, [""]],
- ["STATIC_BALK_1_TYPE", 220.65, 170.15, 0.599, 0.631, -15, [""]],
- ["STATIC_BOX_TYPE", 185.25,
- 180.45, 0.75, 0.75, -10, [""]
- ],
- ["STATIC_BOX_TYPE", 169.35, 92.4, 0.75, 0.75, -10, [""]],
- ["DYNAMIC_RECT_TYPE", 196.55, 125.55, 0.79, 0.79, -100, [""]],
- ["STATIC_BALK_1_TYPE", 247.15, 278.7, 0.725, 0.7, -90, [""]],
- ["STATIC_BALK_1_TYPE", 270.5, 324.95, 0.599, 0.631, 0, [""]],
- ["BOMB_TYPE", 279.25, 297.65, 0.8, 0.8, 0, ["140_1300"]],
- ["STATIC_BALK_1_TYPE", 48.9, 282.55, 0.603, 0.627, 8, [""]],
- ["STATIC_BALK_1_TYPE", 114.1, 291.8, 0.603, 0.627, 8, [""]],
- ["BONUS_STAR_TYPE", 257.25, 115.5, 0.68, 0.68, 0, [""]],
- ["BONUS_STAR_TYPE", 66.3, 249.75, 0.68, 0.68, 0, [""]],
- ["STATIC_BOX_TYPE", 26.8, 212.95, 0.682, 0.662, 5, [""]],
- ["STATIC_BOX_TYPE", 110.15, 219.3, 0.682, 0.662, 5, [""]],
- ["DYNAMIC_RECT_TYPE", 70.6, 198.25, 0.936, 0.79, 5, [""]],
- ["BONUS_STAR_TYPE", 116.35, 343.65, 0.68, 0.68, 0, [""]],
- ["HERO_TYPE", 279.55, 251.3, 0.68, 0.68, 0, [""]],
- ["AIM_TYPE", 43.2, 342.5, 0.73, 0.73, 0, ["DEF"]]
- ],
- [
- ["LAND_TYPE", 208, 292.45, 0.84, 0.84, 0, ["4"]],
- ["LAND_TYPE", 74.5, 166.4, 0.84, 0.84, 0, ["5"]],
- ["HARD_BOX_TYPE", 169.75, 253, 1, 1, 0, ["5"]],
- ["STATIC_BALK_1_TYPE", 113.75, 276.75, 0.7, 0.7, 0, [""]],
- ["DYNAMIC_RECT_TYPE", 72.5,
- 86.85, 0.79, 0.79, 0, [""]
- ],
- ["DYNAMIC_BOX_TYPE", 43.65, 130, 0.42, 0.42, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 103.65, 130, 0.42, 0.42, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 43.65, 107, 0.42, 0.42, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 103.65, 107, 0.42, 0.42, 0, [""]],
- ["STATIC_BALK_1_TYPE", 253.25, 227.65, 0.7, 0.7, -90, [""]],
- ["STATIC_BOX_TYPE", 252.6, 180.5, 0.75, 0.75, 0, [""]],
- ["BOMB_TYPE", 77.75, 61.25, 0.8, 0.8, 0, ["140_600"]],
- ["STATIC_BALK_1_TYPE", 38.1, 329.75, 0.7, 0.7, 30, [""]],
- ["BONUS_STAR_TYPE", 47.8, 296.2, 0.68, 0.68, 0, [""]],
- ["HERO_TYPE", 94.6, 246.6, 0.68, 0.68,
- 0, [""]
- ],
- ["BONUS_STAR_TYPE", 109.6, 344.6, 0.68, 0.68, 0, [""]],
- ["STATIC_BALK_1_TYPE", 39.75, 380.5, 0.7, 0.7, -35, [""]],
- ["AIM_TYPE", 220.6, 378.45, 1.42, 0.74, 0, ["REV_MOVED_R_0_10"]]
- ],
- [
- ["LAND_TYPE", 56, 423.95, 0.84, 0.84, 0, [""]],
- ["STATIC_BALK_1_TYPE", 1, 99.85, 0.7, 0.7, 0, [""]],
- ["FAN_TYPE", 23, 68.6, 0.8, 0.8, 0, ["DEF_100_40"]],
- ["STATIC_BALK_1_TYPE", 76, 99.85, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 151, 99.85, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 151, 195.85, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 226, 195.85, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE",
- 301, 195.85, 0.7, 0.7, 0, [""]
- ],
- ["STATIC_BALK_1_TYPE", 17, 294.85, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 92, 294.85, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 167, 294.85, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 311.95, 99.85, 0.7, 0.7, 0, [""]],
- ["FAN_TYPE", 299.75, 163.85, 0.8, 0.8, 0, ["REV_130_10"]],
- ["FAN_TYPE", 23, 262.6, 0.8, 0.8, 0, ["DEF_200_10"]],
- ["STATIC_BALK_1_TYPE", 151, 404.8, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 226, 404.8, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 301, 404.8, 0.7, 0.7, 0, [""]],
- ["FAN_TYPE", 299.75, 372.8, 0.8, 0.8, 0, ["REV_150_10"]],
- ["HERO_TYPE", 76.95, 67.95, 0.68, 0.68, 0, [""]],
- ["BONUS_STAR_TYPE", 83.85, 159.3, 0.68, 0.68, 0, [""]],
- ["BONUS_STAR_TYPE", 270.8, 299.1, 0.68, 0.68, 0, [""]],
- ["BONUS_STAR_TYPE", 239.8, 62.85, 0.68, 0.68, 0, [""]],
- ["AIM_TYPE", 32.2, 378, 0.73, 0.73, 0, ["DEF"]]
- ],
- [
- ["LAND_TYPE", 175.85, 424.35, 0.746, 0.643, 0, [""]],
- ["TELEPORT_TYPE", 263.7, 350.9, 1, 1, 0, ["A"]],
- ["TELEPORT_TYPE", 31.85, 181.85, 1, 1, 0, ["A"]],
- ["TELEGA_TYPE", 160, 102.3, 2.171, 0.85, 0, ["2_L_0_10"]],
- ["STATIC_BALK_1_TYPE", 94, 391.4, 0.7, 0.7, 30, [""]],
- ["STATIC_BALK_1_TYPE",
- 29, 353.25, 0.7, 0.7, 30, [""]
- ],
- ["HERO_TYPE", 161.2, 72.2, 0.68, 0.68, 0, [""]],
- ["STATIC_BALK_1_TYPE", 37.8, 130.85, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 112.8, 130.85, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 187.8, 130.85, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 341.75, 130.1, 0.7, 0.7, 0, [""]],
- ["STATIC_BOX_TYPE", 225.85, 297.45, 0.75, 0.75, 0, [""]],
- ["STATIC_BOX_TYPE", 301.85, 297.45, 0.75, 0.75, 0, [""]],
- ["DYNAMIC_RECT_TYPE", 102, 207.1, 0.79, 0.79, 0, [""]],
- ["LAND_TYPE", 101.6, 266.6, 0.746, 0.643, 0, [""]],
- ["DYNAMIC_TRIANGLE_TYPE", 80.9, 237.55,
- 0.68, 0.68, -60, [""]
- ],
- ["DYNAMIC_TRIANGLE_TYPE", 130.9, 237.55, 0.68, 0.68, -60, [""]],
- ["STATIC_BALK_1_TYPE", 203.55, 314.25, 0.61, 0.61, 0, [""]],
- ["STATIC_BOX_TYPE", 159.95, 309.7, 0.75, 0.75, 0, [""]],
- ["BONUS_STAR_TYPE", 266.85, 205.7, 0.68, 0.68, 0, [""]],
- ["BONUS_STAR_TYPE", 76.1, 338, 0.68, 0.68, 0, [""]],
- ["BONUS_STAR_TYPE", 30.9, 61.1, 0.68, 0.68, 0, [""]],
- ["HARD_RECT_TYPE", 263.7, 276.25, 0.856, 0.857, 0, [""]],
- ["BOMB_TYPE", 101.7, 181.4, 0.8, 0.8, 0, ["90_1000"]],
- ["AIM_TYPE", 185.35, 381.1, 0.74, 0.74, 0, ["REV"]]
- ],
- [
- ["STATIC_BOX_TYPE", 286.55, 344.25,
- 0.5, 1.06, -12, ["INVIS"]
- ],
- ["LAND_TYPE", 246.85, 399.45, 0.84, 0.84, 0, ["5"]],
- ["LAND_TYPE", 265.5, 247.55, 0.765, 0.807, 0, [""]],
- ["STATIC_BALK_1_TYPE", 47, 55.45, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 123.2, 55.45, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 199.4, 55.45, 0.7, 0.7, 0, [""]],
- ["STATIC_BALK_1_TYPE", 267.35, 82.8, 0.7, 0.7, 45, [""]],
- ["BOMB_TYPE", 265.7, 205.4, 0.8, 0.8, 0, ["140_1000"]],
- ["TELEGA_TYPE", 173, 165.55, 2.037, 0.85, 0, ["1_L_0_10"]],
- ["STATIC_BALK_1_TYPE", 17.4, 101.25, 0.7, 0.7, -90, [""]],
- ["STATIC_BALK_1_TYPE", 17.4, 175.25,
- 0.7, 0.7, -90, [""]
- ],
- ["STATIC_BOX_TYPE", 21.1, 258.8, 0.75, 0.75, 0, [""]],
- ["STATIC_BOX_TYPE", 112.2, 258.8, 0.75, 0.75, 0, [""]],
- ["DYNAMIC_RECT_TYPE", 68, 221.75, 0.954, 0.79, 0, [""]],
- ["STATIC_BALK_1_TYPE", 130.4, 236, 0.64, 0.64, -90, [""]],
- ["STATIC_BALK_1_TYPE", 48.2, 395.85, 0.7, 0.7, -7, [""]],
- ["STATIC_BALK_1_TYPE", 123.9, 387.1, 0.7, 0.7, -7, [""]],
- ["FAN_TYPE", 28.05, 364.9, 0.8, 0.8, -8, ["DEF_130_40"]],
- ["GLASS_BLOCK_TYPE", 68.35, 238.75, 0.973, 0.79, 0, [""]],
- ["HERO_TYPE", 175.85, 135.2, 0.68, 0.68, 0, [""]],
- ["BONUS_STAR_TYPE", 62.85, 114.25, 0.65,
- 0.65, 0, [""]
- ],
- ["BONUS_STAR_TYPE", 67.3, 287.7, 0.65, 0.65, 0, [""]],
- ["BONUS_STAR_TYPE", 169.4, 340.2, 0.65, 0.65, 0, [""]],
- ["AIM_TYPE", 258.35, 351.15, 0.74, 0.74, 0, ["REV"]]
- ],
- [
- ["STATIC_BOX_TYPE", 84.05, 70.2, 0.5, 1.06, 15, ["INVIS"]],
- ["STATIC_BOX_TYPE", 258.4, 331.3, 0.75, 0.75, 0, [""]],
- ["BONUS_STAR_TYPE", 187.85, 321.9, 0.65, 0.65, 0, [""]],
- ["BONUS_STAR_TYPE", 61.55, 219.75, 0.65, 0.65, 0, [""]],
- ["BONUS_STAR_TYPE", 221.45, 110.25, 0.65, 0.65, 0, [""]],
- ["DYNAMIC_RECT_TYPE", 52.2, 161.75, 0.918, 0.989, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 25.1, 142.95, 0.42,
- 0.42, 0, [""]
- ],
- ["DYNAMIC_BOX_TYPE", 76.05, 142.95, 0.42, 0.42, 0, [""]],
- ["LAND_TYPE", 128.15, 124.6, 0.702, 0.643, -9, [""]],
- ["DYNAMIC_BOX_TYPE", 19.4, 322.25, 0.42, 0.42, 0, ["3"]],
- ["DYNAMIC_BOX_TYPE", 95.7, 321.75, 0.42, 0.42, 0, ["3"]],
- ["DYNAMIC_BOX_TYPE", 95.85, 300.6, 0.42, 0.42, 0, [""]],
- ["DYNAMIC_BOX_TYPE", 19.85, 300.1, 0.42, 0.42, 0, [""]],
- ["DYNAMIC_RECT_TYPE", 58.15, 279.25, 0.918, 0.989, 0, [""]],
- ["HARD_BOX_TYPE", 12.85, 183.9, 0.877, 0.852, 0, ["5"]],
- ["HARD_BOX_TYPE", 89, 183.9, 0.877, 0.852, 0, ["5"]],
- ["STATIC_BALK_1_TYPE", 59.35, 342.15, 0.903,
- 0.886, 0, [""]
- ],
- ["STATIC_BALK_1_TYPE", 183.5, 424.75, 0.801, 0.817, -53, [""]],
- ["STATIC_BALK_1_TYPE", 233.4, 356.8, 0.747, 0.919, -55, [""]],
- ["STATIC_BALK_1_TYPE", 218.6, 211.85, 0.64, 0.92, -113, [""]],
- ["STATIC_BOX_TYPE", 13.5, 208.2, 0.75, 0.75, 0, [""]],
- ["STATIC_BALK_1_TYPE", 313.85, 266.15, 0.779, 0.919, -110, [""]],
- ["STATIC_BOX_TYPE", 89, 208.2, 0.75, 0.75, 0, [""]],
- ["FAN_TYPE", 286.65, 320.25, 0.8, 0.8, 75, ["REV_780_15"]],
- ["FAN_TYPE", 154.25, 405.65, 0.8, 0.8, -52, ["DEF_230_40"]],
- ["HERO_TYPE", 50.35, 113.35, 0.68, 0.68, 0, [""]],
- ["STATIC_BALK_1_TYPE",
- 186.9, 147.1, 0.64, 0.92, -120, [""]
- ],
- ["AIM_TYPE", 114.35, 81.25, 0.73, 0.73, -9, ["DEF"]]
- ]
- ],
- allBgIndexes = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- isEditorDebug = !1,
- editorLevelToLoad = 3,
- manifest = [{
- src: PRELOADER_LOGO,
- id: "preloaderlogo"
- }, {
- src: "soccerassets.png",
- id: "zoespritesheet"
- }],
- zoeCFG = {
- framerate: 24,
- images: ["assets/soccerassets.png"],
- frames: [
- [946, 1742, 37, 33, 0, 17, 15],
- [1051, 1742, 37, 33, 0, 17, 15],
- [909, 1742, 37, 33, 0, 17, 15],
- [1252, 2, 312, 244, 0, 159, 148],
- [131, 692, 128, 127, 0, 63, 59],
- [846, 1694, 230, 45, 0, 104, 17],
- [448, 1555,
- 74, 73, 0, 35, 31
- ],
- [355, 936, 87, 86, 0, 41, 41],
- [529, 936, 87, 86, 0, 41, 41],
- [473, 1628, 168, 62, 0, 81, 30],
- [1242, 1105, 77, 76, 0, 37, 34],
- [700, 1028, 77, 77, 0, 37, 34],
- [855, 1028, 77, 77, 0, 37, 34],
- [546, 1105, 78, 77, 0, 37, 35],
- [442, 936, 87, 86, 0, 41, 39],
- [1920, 1555, 67, 66, 0, 31, 29],
- [1987, 1555, 62, 61, 0, 29, 27],
- [276, 1742, 36, 40, 0, 0, 0],
- [281, 362, 201, 182, 0, 95, 30],
- [1751, 820, 87, 93, 0, 41, 48],
- [1664, 820, 87, 93, 0, 41, 48],
- [1838, 820, 87, 93, 0, 41, 48],
- [482, 362, 298, 166, 0, 146, 141],
- [1578, 936, 80, 79, 0, 39, 36],
- [853, 936, 93, 82, 0, 46, 43],
- [1409, 1628, 161, 50, 0, 80, 23],
- [2, 1694,
- 261, 48, 0, 125, 17
- ],
- [1076, 1694, 141, 45, 0, 71, 21],
- [2, 1785, 174, 30, 0, 84, 12],
- [1274, 1742, 228, 32, 0, 113, 14],
- [1649, 1742, 149, 31, 0, 73, 14],
- [1088, 1742, 186, 32, 0, 93, 14],
- [1798, 1742, 206, 30, 0, 102, 12],
- [176, 1785, 150, 30, 0, 74, 12],
- [2, 820, 168, 116, 0, 86, 57],
- [1019, 1628, 276, 52, 0, 136, 24],
- [2, 544, 160, 148, 0, 73, 68],
- [540, 1694, 306, 47, 0, 150, 20],
- [981, 2, 271, 275, 0, 128, 148],
- [270, 544, 139, 147, 0, 71, 81],
- [1564, 2, 221, 221, 0, 109, 108],
- [2044, 2, 4, 4, 0, 200, 200],
- [1741, 1628, 159, 49, 0, 78, 18],
- [170, 820, 314, 113, 0, 154, 34],
- [1900, 1628, 138, 49, 0, 96, 23],
- [843, 1785, 157,
- 26, 0, 75, 11
- ],
- [1740, 936, 233, 78, 0, 99, 44],
- [2, 1628, 204, 66, 0, 100, 32],
- [2017, 820, 28, 45, 0, -4, 0],
- [1374, 1694, 35, 44, 0, 0, 0],
- [1462, 1694, 33, 44, 0, -1, 0],
- [1495, 1694, 35, 44, 0, 0, 0],
- [1614, 1694, 33, 44, 0, -1, 0],
- [1682, 1694, 35, 44, 0, 0, 0],
- [1647, 1694, 35, 44, 0, 0, 0],
- [1581, 1694, 33, 44, 0, -1, 0],
- [1340, 1694, 34, 44, 0, -1, 0],
- [2013, 1105, 35, 45, 0, 0, 1],
- [1113, 1785, 114, 26, 0, 55, 11],
- [1388, 820, 94, 94, 0, 0, 0],
- [271, 1628, 138, 66, 0, 67, 32],
- [817, 1555, 138, 72, 0, 67, 33],
- [1438, 1555, 138, 68, 0, 67, 32],
- [1576, 1555, 138, 68, 0, 67, 32],
- [1714, 1555, 138, 67, 0, 67, 32],
- [598, 820, 114,
- 113, 0, 55, 54
- ],
- [1508, 692, 120, 119, 0, 57, 58],
- [382, 692, 124, 123, 0, 60, 59],
- [1031, 692, 120, 121, 0, 58, 59],
- [1E3, 1785, 113, 26, 0, 54, 10],
- [499, 1785, 113, 26, 0, 54, 10],
- [1627, 1628, 57, 50, 0, 27, 24],
- [874, 1742, 35, 34, 0, 15, 15],
- [612, 1785, 116, 26, 0, 55, 10],
- [517, 1742, 35, 36, 0, 15, 16],
- [481, 1742, 36, 36, 0, 15, 16],
- [717, 1742, 35, 35, 0, 15, 16],
- [587, 1742, 35, 35, 0, 15, 16],
- [752, 1742, 35, 35, 0, 15, 15],
- [552, 1742, 35, 36, 0, 15, 16],
- [1684, 1628, 57, 50, 0, 27, 24],
- [522, 1555, 73, 73, 0, 35, 34],
- [701, 1628, 58, 58, 0, 27, 27],
- [759, 1628, 59, 58, 0, 27, 27],
- [818, 1628, 58, 56, 0, 27, 26],
- [1570,
- 1628, 57, 50, 0, 27, 24
- ],
- [641, 1628, 60, 60, 0, 28, 29],
- [263, 1694, 50, 48, 0, 24, 22],
- [202, 936, 72, 88, 0, 35, 44],
- [274, 936, 81, 87, 0, 30, 44],
- [1693, 544, 150, 132, 0, 40, 44],
- [1284, 1694, 56, 44, 0, 27, 22],
- [1502, 1742, 68, 32, 0, 34, 14],
- [787, 1742, 87, 35, 0, 46, 14],
- [1570, 1742, 79, 32, 0, 45, 14],
- [622, 1742, 95, 35, 0, 55, 15],
- [1993, 1258, 56, 65, 0, 26, 36],
- [409, 1628, 64, 65, 0, 28, 38],
- [1295, 1628, 55, 51, 0, 25, 27],
- [206, 1628, 65, 66, 0, 29, 33],
- [1436, 936, 82, 79, 0, 37, 43],
- [1022, 936, 89, 81, 0, 39, 44],
- [107, 936, 95, 88, 0, 43, 46],
- [1180, 820, 102, 95, 0, 44, 49],
- [2, 936, 105, 92, 0, 45, 47],
- [1282,
- 820, 106, 94, 0, 47, 48
- ],
- [1559, 820, 105, 93, 0, 44, 49],
- [350, 1742, 131, 37, 0, 64, 17],
- [876, 1628, 90, 55, 0, 45, 26],
- [1981, 1182, 68, 69, 0, 32, 33],
- [1852, 1555, 68, 67, 0, 31, 33],
- [385, 1785, 114, 27, 0, 55, 11],
- [326, 1785, 30, 30, 0, 14, 15],
- [2004, 1742, 33, 30, 0, 15, 14],
- [356, 1785, 29, 28, 0, 13, 12],
- [983, 1742, 35, 33, 0, 16, 16],
- [1227, 1785, 35, 25, 0, 16, 8],
- [1262, 1785, 127, 23, 0, 65, 10],
- [1516, 1785, 127, 23, 0, 65, 10],
- [1389, 1785, 127, 23, 0, 65, 10],
- [1350, 1628, 59, 50, 0, 27, 22],
- [728, 1785, 115, 26, 0, 54, 10],
- [312, 1742, 38, 38, 0, 17, 17],
- [427, 1694, 113, 48, 0, 54, 22],
- [313, 1694, 114, 48,
- 0, 55, 22
- ],
- [1104, 1555, 334, 72, 0, 1, -2],
- [1418, 1482, 334, 73, 0, 1, -1],
- [232, 1408, 334, 74, 0, 1, 0],
- [566, 1408, 334, 74, 0, 1, 0],
- [1414, 1182, 334, 75, 0, 1, 1],
- [1080, 1182, 334, 75, 0, 1, 1],
- [1198, 1408, 334, 74, 0, 1, 0],
- [1680, 1408, 334, 74, 0, 1, 0],
- [634, 1482, 334, 73, 0, 1, -1],
- [300, 1482, 334, 73, 0, 1, -1],
- [2, 2, 554, 360, 0, 0, 0],
- [556, 2, 425, 314, 0, 0, 0],
- [2022, 692, 25, 46, 0, -23, -13],
- [1251, 1694, 33, 44, 0, -20, -14],
- [2017, 1028, 32, 45, 0, -21, -15],
- [2014, 1408, 34, 45, 0, -18, -14],
- [1217, 1694, 34, 45, 0, -21, -15],
- [1907, 1694, 34, 43, 0, -20, -16],
- [245, 1742, 31, 42, 0, -22, -17],
- [215, 1742,
- 30, 43, 0, -22, -17
- ],
- [1875, 1694, 32, 43, 0, -21, -16],
- [108, 1742, 53, 43, 0, -11, -16],
- [1994, 1694, 45, 43, 0, -14, -17],
- [1941, 1694, 53, 43, 0, -10, -16],
- [1409, 1694, 53, 44, 0, -10, -15],
- [161, 1742, 54, 43, 0, -11, -15],
- [2, 1742, 52, 43, 0, -11, -16],
- [54, 1742, 54, 43, 0, -11, -16],
- [1824, 1694, 51, 43, 0, -11, -16],
- [1530, 1694, 51, 44, 0, -11, -16],
- [1717, 1694, 51, 43, 0, -11, -16],
- [1768, 1694, 56, 43, 0, -10, -16],
- [310, 1182, 76, 76, 0, 36, 36],
- [1165, 1028, 76, 77, 0, 36, 37],
- [540, 1258, 76, 75, 0, 36, 36],
- [1004, 1258, 75, 75, 0, 36, 36],
- [1290, 1333, 74, 74, 0, 35, 36],
- [2, 1482, 74, 73, 0, 35, 36],
- [1142,
- 1333, 74, 74, 0, 35, 37
- ],
- [1068, 1333, 74, 74, 0, 35, 38],
- [995, 1333, 73, 74, 0, 35, 38],
- [1762, 1258, 75, 75, 0, 36, 39],
- [1154, 1258, 75, 75, 0, 36, 39],
- [1533, 1258, 75, 75, 0, 36, 39],
- [386, 1182, 76, 76, 0, 36, 40],
- [78, 1182, 76, 76, 0, 36, 40],
- [1241, 1028, 76, 77, 0, 36, 40],
- [1317, 1028, 78, 77, 0, 37, 40],
- [1395, 1028, 78, 77, 0, 37, 40],
- [1706, 1028, 78, 77, 0, 37, 40],
- [1549, 1028, 79, 77, 0, 37, 40],
- [1628, 1028, 78, 77, 0, 36, 40],
- [154, 1182, 78, 76, 0, 36, 39],
- [616, 1182, 78, 76, 0, 36, 39],
- [462, 1182, 78, 76, 0, 36, 39],
- [2, 1258, 78, 75, 0, 36, 38],
- [306, 1258, 78, 75, 0, 36, 38],
- [1686, 1258, 76, 75, 0, 35, 38],
- [232, 1333, 76, 74, 0, 35, 38],
- [539, 1333, 76, 74, 0, 35, 38],
- [1343, 1482, 75, 73, 0, 35, 37],
- [373, 1555, 75, 73, 0, 35, 37],
- [1030, 1555, 74, 72, 0, 35, 36],
- [955, 1555, 75, 72, 0, 36, 36],
- [308, 1333, 76, 74, 0, 36, 37],
- [768, 1333, 76, 74, 0, 36, 37],
- [844, 1333, 77, 74, 0, 37, 37],
- [926, 1258, 78, 75, 0, 37, 37],
- [848, 1258, 78, 75, 0, 37, 37],
- [770, 1258, 78, 75, 0, 37, 37],
- [232, 1182, 78, 76, 0, 37, 38],
- [624, 1105, 78, 77, 0, 37, 38],
- [702, 1105, 78, 77, 0, 37, 38],
- [780, 1105, 77, 77, 0, 37, 38],
- [1863, 1028, 77, 77, 0, 37, 38],
- [1940, 1028, 77, 77, 0, 37, 38],
- [314, 1105, 76, 77, 0, 37, 38],
- [155, 1258, 76, 75, 0, 37, 37],
- [80, 1258, 75, 75, 0, 37, 37],
- [1512, 1333, 75, 74, 0, 37, 36],
- [1664, 1333, 74, 74, 0, 37, 36],
- [2, 1555, 74, 73, 0, 37, 35],
- [158, 1333, 74, 74, 0, 37, 35],
- [1738, 1333, 74, 74, 0, 37, 34],
- [1364, 1333, 74, 74, 0, 37, 34],
- [1004, 1182, 76, 75, 0, 38, 35],
- [1089, 1105, 76, 77, 0, 38, 36],
- [540, 1182, 76, 76, 0, 38, 36],
- [857, 1105, 78, 77, 0, 39, 37],
- [158, 1105, 78, 77, 0, 39, 37],
- [236, 1105, 78, 77, 0, 39, 37],
- [544, 1028, 78, 77, 0, 39, 37],
- [694, 1182, 78, 75, 0, 39, 36],
- [850, 1182, 78, 75, 0, 39, 36],
- [1587, 1333, 77, 74, 0, 38, 36],
- [1119, 1482, 75, 73, 0, 37, 35],
- [1194, 1482, 74, 73, 0, 36, 35],
- [223, 1555, 75, 73, 0, 36,
- 35
- ],
- [298, 1555, 75, 73, 0, 35, 36],
- [692, 1333, 76, 74, 0, 35, 36],
- [615, 1333, 77, 74, 0, 36, 36],
- [1748, 1182, 78, 75, 0, 37, 36],
- [772, 1182, 78, 75, 0, 37, 36],
- [935, 1105, 78, 77, 0, 37, 37],
- [390, 1105, 78, 77, 0, 37, 37],
- [468, 1105, 78, 77, 0, 37, 37],
- [1165, 1105, 77, 77, 0, 36, 37],
- [1319, 1105, 76, 76, 0, 36, 36],
- [1472, 1105, 76, 76, 0, 36, 36],
- [1013, 1105, 76, 77, 0, 36, 37],
- [928, 1182, 76, 75, 0, 36, 36],
- [231, 1258, 75, 75, 0, 36, 36],
- [1438, 1333, 74, 74, 0, 35, 36],
- [149, 1555, 74, 73, 0, 35, 36],
- [1216, 1333, 74, 74, 0, 35, 37],
- [921, 1333, 74, 74, 0, 35, 38],
- [76, 1555, 73, 73, 0, 35, 38],
- [1812, 1333, 75, 74,
- 0, 36, 39
- ],
- [1307, 1258, 75, 75, 0, 36, 39],
- [1382, 1258, 75, 75, 0, 36, 39],
- [2, 1182, 76, 76, 0, 36, 40],
- [1702, 1105, 76, 76, 0, 36, 40],
- [1548, 1105, 76, 76, 0, 36, 40],
- [80, 1105, 78, 77, 0, 37, 40],
- [2, 1105, 78, 77, 0, 37, 40],
- [1856, 1105, 78, 76, 0, 37, 40],
- [1934, 1105, 79, 76, 0, 37, 40],
- [1784, 1028, 79, 77, 0, 37, 40],
- [1778, 1105, 78, 76, 0, 36, 39],
- [80, 1333, 78, 75, 0, 36, 39],
- [1915, 1258, 78, 75, 0, 36, 39],
- [1837, 1258, 78, 75, 0, 36, 39],
- [384, 1333, 78, 74, 0, 36, 38],
- [462, 1333, 77, 74, 0, 35, 38],
- [1887, 1333, 76, 74, 0, 35, 38],
- [968, 1482, 76, 73, 0, 35, 37],
- [1268, 1482, 75, 73, 0, 34, 37],
- [1044, 1482,
- 75, 73, 0, 35, 37
- ],
- [225, 1482, 75, 73, 0, 35, 37],
- [595, 1555, 75, 72, 0, 36, 36],
- [150, 1482, 75, 73, 0, 36, 36],
- [1963, 1333, 76, 74, 0, 36, 37],
- [2, 1408, 76, 74, 0, 36, 37],
- [78, 1408, 77, 74, 0, 37, 37],
- [1903, 1182, 78, 75, 0, 37, 37],
- [1229, 1258, 78, 75, 0, 37, 37],
- [462, 1258, 78, 75, 0, 37, 37],
- [1624, 1105, 78, 76, 0, 37, 38],
- [155, 1028, 78, 77, 0, 37, 38],
- [1087, 1028, 78, 77, 0, 37, 38],
- [1010, 1028, 77, 77, 0, 37, 38],
- [1973, 936, 77, 77, 0, 37, 38],
- [78, 1028, 77, 77, 0, 37, 38],
- [2, 1028, 76, 77, 0, 37, 38],
- [694, 1258, 76, 75, 0, 37, 37],
- [1079, 1258, 75, 75, 0, 37, 37],
- [1049, 1408, 75, 74, 0, 37, 36],
- [1124, 1408,
- 74, 74, 0, 37, 36
- ],
- [76, 1482, 74, 73, 0, 37, 35],
- [1532, 1408, 74, 74, 0, 37, 35],
- [1606, 1408, 74, 74, 0, 37, 34],
- [975, 1408, 74, 74, 0, 37, 34],
- [1457, 1258, 76, 75, 0, 38, 35],
- [1473, 1028, 76, 77, 0, 38, 36],
- [1395, 1105, 77, 76, 0, 38, 36],
- [233, 1028, 78, 77, 0, 39, 37],
- [777, 1028, 78, 77, 0, 39, 37],
- [622, 1028, 78, 77, 0, 39, 37],
- [616, 1258, 78, 75, 0, 39, 36],
- [384, 1258, 78, 75, 0, 39, 36],
- [1826, 1182, 77, 75, 0, 38, 36],
- [1752, 1482, 77, 73, 0, 38, 35],
- [1829, 1482, 75, 73, 0, 37, 35],
- [1904, 1482, 75, 73, 0, 36, 35],
- [670, 1555, 75, 72, 0, 35, 35],
- [900, 1408, 75, 74, 0, 35, 36],
- [155, 1408, 77, 74, 0, 36, 36],
- [2,
- 1333, 78, 75, 0, 37, 36
- ],
- [1608, 1258, 78, 75, 0, 37, 36],
- [311, 1028, 78, 77, 0, 37, 37],
- [932, 1028, 78, 77, 0, 37, 37],
- [389, 1028, 78, 77, 0, 37, 37],
- [467, 1028, 77, 77, 0, 36, 37],
- [1306, 936, 65, 80, 0, 30, 38],
- [1371, 936, 65, 80, 0, 30, 38],
- [1241, 936, 65, 80, 0, 30, 38],
- [1176, 936, 65, 80, 0, 30, 38],
- [1111, 936, 65, 80, 0, 30, 38],
- [2, 362, 279, 182, 0, 0, 0],
- [1785, 2, 215, 160, 0, 0, 1],
- [2E3, 2, 44, 93, 0, 19, 73],
- [1973, 544, 57, 107, 0, 27, 77],
- [830, 692, 80, 122, 0, 39, 81],
- [1948, 362, 101, 135, 0, 50, 84],
- [1050, 544, 103, 139, 0, 51, 87],
- [662, 544, 104, 144, 0, 51, 91],
- [556, 544, 106, 145, 0, 52, 91],
- [162, 544,
- 108, 147, 0, 53, 92
- ],
- [1689, 362, 110, 150, 0, 54, 93],
- [750, 692, 80, 122, 0, 40, 93],
- [1862, 692, 80, 116, 0, 40, 94],
- [1942, 692, 80, 112, 0, 40, 95],
- [712, 820, 79, 110, 0, 39, 97],
- [900, 820, 78, 106, 0, 39, 98],
- [1482, 820, 77, 93, 0, 38, 100],
- [700, 936, 77, 83, 0, 38, 92],
- [777, 936, 76, 82, 0, 37, 93],
- [946, 936, 76, 81, 0, 37, 94],
- [1518, 936, 60, 79, 0, 22, 94],
- [1658, 936, 42, 78, 0, 21, 95],
- [1700, 936, 40, 78, 0, 20, 96],
- [2030, 544, 13, 13, 0, 0, 83],
- [1979, 1482, 68, 67, 0, 32, 32],
- [616, 936, 84, 83, 0, 40, 40],
- [791, 820, 109, 109, 0, 53, 53],
- [1843, 544, 130, 129, 0, 63, 63],
- [1291, 544, 135, 135, 0, 66, 66],
- [909,
- 544, 141, 141, 0, 69, 69
- ],
- [933, 362, 152, 152, 0, 75, 74],
- [780, 362, 153, 152, 0, 75, 74],
- [1085, 362, 152, 151, 0, 75, 74],
- [1388, 362, 151, 151, 0, 74, 74],
- [1237, 362, 151, 151, 0, 74, 74],
- [1539, 362, 150, 150, 0, 74, 73],
- [1799, 362, 149, 148, 0, 73, 72],
- [409, 544, 147, 146, 0, 72, 71],
- [766, 544, 143, 143, 0, 70, 70],
- [1153, 544, 138, 137, 0, 68, 67],
- [1426, 544, 135, 134, 0, 66, 65],
- [1561, 544, 132, 132, 0, 65, 64],
- [2, 692, 129, 128, 0, 63, 62],
- [1018, 1742, 33, 33, 0, 15, 15],
- [966, 1628, 53, 52, 0, 25, 25],
- [745, 1555, 72, 72, 0, 35, 35],
- [1925, 820, 92, 92, 0, 45, 45],
- [1084, 820, 96, 95, 0, 46, 46],
- [978, 820, 106,
- 106, 0, 51, 51
- ],
- [484, 820, 114, 113, 0, 55, 55],
- [1746, 692, 116, 117, 0, 56, 57],
- [1151, 692, 118, 119, 0, 57, 58],
- [1628, 692, 118, 118, 0, 57, 57],
- [1269, 692, 119, 119, 0, 58, 58],
- [1388, 692, 120, 119, 0, 58, 58],
- [910, 692, 121, 121, 0, 59, 59],
- [628, 692, 122, 122, 0, 59, 59],
- [506, 692, 122, 123, 0, 59, 60],
- [259, 692, 123, 123, 0, 60, 60]
- ],
- animations: {
- 0: {
- frames: [56],
- speed: 1
- },
- 1: {
- frames: [48],
- speed: 1
- },
- 2: {
- frames: [49],
- speed: 1
- },
- 3: {
- frames: [50],
- speed: 1
- },
- 4: {
- frames: [51],
- speed: 1
- },
- 5: {
- frames: [52, 52],
- speed: 1
- },
- 6: {
- frames: [57],
- speed: 1
- },
- 7: {
- frames: [53],
- speed: 1
- },
- 8: {
- frames: [54],
- speed: 1
- },
- 9: {
- frames: [55],
- speed: 1
- },
- lvlnum4: {
- frames: [140],
- speed: 1
- },
- BONUS_STAR_TYPE: {
- frames: [91],
- speed: 1
- },
- lvlnum20: {
- frames: [156],
- speed: 1
- },
- particle3v: {
- frames: [2],
- speed: 1
- },
- AIM_TYPE: {
- frames: [88],
- speed: 1
- },
- logov: {
- frames: [3],
- speed: 1
- },
- lvlnum6: {
- frames: [142],
- speed: 1
- },
- biglimetxt: {
- frames: [43],
- speed: 1
- },
- parteffectv3: {
- frames: [356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 41, 41, 41],
- speed: 1
- },
- particleglass2: {
- frames: [113],
- speed: 1
- },
- lvlnum9: {
- frames: [145],
- speed: 1
- },
- lvlnum5: {
- frames: [141],
- speed: 1
- },
- musiconbtn: {
- frames: [11],
- speed: 1
- },
- TELEPORT_TYPE: {
- frames: [157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
- 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307
- ],
- speed: 1
- },
- HARD_RECT_TYPE_2: {
- frames: [70],
- speed: 1
- },
- particleglass1: {
- frames: [112],
- speed: 1
- },
- GLASS_BLOCK_TYPE: {
- frames: [111],
- speed: 1
- },
- achievdesc2: {
- frames: [30],
- speed: 1
- },
- achievdesc1: {
- frames: [29],
- speed: 1
- },
- lvlnum3: {
- frames: [139],
- speed: 1
- },
- tint2: {
- frames: [59],
- speed: 1
- },
- DECOR_HELP_3_TYPE: {
- frames: [67],
- speed: 1
- },
- backbtn: {
- frames: [6],
- speed: 1
- },
- creditstitle: {
- frames: [42],
- speed: 1
- },
- achievdesc4: {
- frames: [32],
- speed: 1
- },
- lvlnum19: {
- frames: [155],
- speed: 1
- },
- lvlnum16: {
- frames: [152],
- speed: 1
- },
- creditselk: {
- frames: [34],
- speed: 1
- },
- lvlnum2: {
- frames: [138],
- speed: 1
- },
- radugav: {
- frames: [40, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41],
- speed: 1
- },
- STATIC_BALK_1_TYPE_2: {
- frames: [73, 73],
- speed: 1
- },
- bgwinv: {
- frames: [136],
- speed: 1
- },
- MONSTER_TYPE: {
- frames: [109, 110, 109],
- speed: 1
- },
- tintbg: {
- frames: [17],
- speed: 1
- },
- DECOR_HELP_2_TYPE: {
- frames: [66],
- speed: 1
- },
- achievback: {
- frames: [35],
- speed: 1
- },
- STATIC_BOX_TYPE: {
- frames: [72, 72, 72, 72, 72,
- 72, 72, 72, 72, 72, 72, 72, 72, 72
- ],
- speed: 1
- },
- lvlnum17: {
- frames: [153],
- speed: 1
- },
- lvlnum18: {
- frames: [154],
- speed: 1
- },
- HARD_RECT_TYPE: {
- frames: [69],
- speed: 1
- },
- nextlevelwin: {
- frames: [23],
- speed: 1
- },
- lvlnum1: {
- frames: [137],
- speed: 1
- },
- deathanimv: {
- frames: [108],
- speed: 1
- },
- TELEGA_TYPE: {
- frames: [123],
- speed: 1
- },
- fansv: {
- frames: [125, 126, 127, 128, 129, 130, 131, 132, 133, 134],
- speed: 1
- },
- playbtnup: {
- frames: [4],
- speed: 1
- },
- PART_50: {
- frames: [92],
- speed: 1
- },
- lvlnum15: {
- frames: [151],
- speed: 1
- },
- achievdesc0: {
- frames: [28],
- speed: 1
- },
- BOMB_TYPE: {
- frames: [96],
- speed: 1
- },
- achievdesc5: {
- frames: [33],
- speed: 1
- },
- DANGER_TYPE: {
- frames: [107],
- speed: 1
- },
- achievdesc3: {
- frames: [31],
- speed: 1
- },
- DYNAMIC_CIRCLE_TYPE: {
- frames: [122],
- speed: 1
- },
- TELEGA_TYPE_2: {
- frames: [124, 124],
- speed: 1
- },
- STATIC_BALK_1_TYPE: {
- frames: [58],
- speed: 1
- },
- LAND_TYPE_2: {
- frames: [61],
- speed: 1
- },
- bombexplosionv: {
- frames: [97, 98, 99, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106],
- speed: 1
- },
- restartbtn: {
- frames: [13],
- speed: 1
- },
- DECOR_HELP_1_TYPE: {
- frames: [65],
- speed: 1
- },
- AIM_TYPE_MOVABLE: {
- frames: [90],
- speed: 1
- },
- DYNAMIC_RECT_TYPE_2: {
- frames: [121],
- speed: 1
- },
- spelelogo: {
- frames: [47],
- speed: 1
- },
- tryagaintitle: {
- frames: [18],
- speed: 1
- },
- splashlogo: {
- frames: [46],
- speed: 1
- },
- particleglass3: {
- frames: [114],
- speed: 1
- },
- lvlnum14: {
- frames: [150],
- speed: 1
- },
- BONUS_GHOST_TYPE: {
- frames: [120],
- speed: 1
- },
- LAND_TYPE: {
- frames: [60],
- speed: 1
- },
- totalscoreslabel: {
- frames: [45],
- speed: 1
- },
- levelreadylabel: {
- frames: [44],
- speed: 1
- },
- DECOR_HELP_4_TYPE: {
- frames: [68, 68, 68, 68],
- speed: 1
- },
- LAND_TYPE_5: {
- frames: [64],
- speed: 1
- },
- particle2v: {
- frames: [1],
- speed: 1
- },
- moregames2v: {
- frames: [25],
- speed: 1
- },
- lvlnum12: {
- frames: [148],
- speed: 1
- },
- ACTIVATOR_TYPE: {
- frames: [115,
- 116, 116
- ],
- speed: 1
- },
- levelselecttitle: {
- frames: [5],
- speed: 1
- },
- LAND_TYPE_3: {
- frames: [62],
- speed: 1
- },
- DOOR_TYPE: {
- frames: [117, 118, 119],
- speed: 1
- },
- particle1v: {
- frames: [0],
- speed: 1
- },
- lvlnum13: {
- frames: [149],
- speed: 1
- },
- pausetitle: {
- frames: [9],
- speed: 1
- },
- parteffectv2: {
- frames: [337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 41],
- speed: 1
- },
- BONUS_DIAMOND_TYPE: {
- frames: [86],
- speed: 1
- },
- btnbaseup: {
- frames: [15],
- speed: 1
- },
- DYNAMIC_BOX_TYPE_3: {
- frames: [84],
- speed: 1
- },
- lvlLabelStar0: {
- frames: [7],
- speed: 1
- },
- DYNAMIC_BOX_TYPE_2: {
- frames: [83],
- speed: 1
- },
- lvlLabelStar3: {
- frames: [21],
- speed: 1
- },
- lvlLabelStar2: {
- frames: [20],
- speed: 1
- },
- newachievtitle: {
- frames: [37],
- speed: 1
- },
- lvlLabelStar1: {
- frames: [19],
- speed: 1
- },
- lvlcompletebgnew: {
- frames: [22],
- speed: 1
- },
- PART_200: {
- frames: [95, 95],
- speed: 1
- },
- HARD_BOX_TYPE_5: {
- frames: [78],
- speed: 1
- },
- GLASS_BOX_TYPE: {
- frames: [79],
- speed: 1
- },
- DYNAMIC_RECT_TYPE: {
- frames: [73],
- speed: 1
- },
- DYNAMIC_TRIANGLE_TYPE: {
- frames: [85, 85, 85, 85, 85],
- speed: 1
- },
- PART_150: {
- frames: [94],
- speed: 1
- },
- HERO_TYPE: {
- frames: [81],
- speed: 1
- },
- HARD_BOX_TYPE_4: {
- frames: [77],
- speed: 1
- },
- achievmenutitle: {
- frames: [26],
- speed: 1
- },
- bigbg: {
- frames: [135],
- speed: 1
- },
- parteffectv1: {
- frames: [315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336],
- speed: 1
- },
- quitbtn: {
- frames: [10],
- speed: 1
- },
- achievclosed: {
- frames: [27],
- speed: 1
- },
- musicoffbtn: {
- frames: [12],
- speed: 1
- },
- achievbtn: {
- frames: [14],
- speed: 1
- },
- smallwinv: {
- frames: [314],
- speed: 1
- },
- completeelk: {
- frames: [39],
- speed: 1
- },
- lvlnum10: {
- frames: [146],
- speed: 1
- },
- levelbuttonlocked: {
- frames: [8],
- speed: 1
- },
- lvlnum11: {
- frames: [147],
- speed: 1
- },
- pausebtn: {
- frames: [16],
- speed: 1
- },
- HARD_BOX_TYPE_3: {
- frames: [76],
- speed: 1
- },
- HARD_BOX_TYPE_2: {
- frames: [75],
- speed: 1
- },
- PART_100: {
- frames: [93],
- speed: 1
- },
- HARD_BOX_TYPE: {
- frames: [74],
- speed: 1
- },
- FAN_TYPE_ON: {
- frames: [309, 310, 311, 312, 309, 310, 311, 312, 309, 309],
- speed: 1
- },
- AIM_BACK: {
- frames: [89],
- speed: 1
- },
- newachievbgv: {
- frames: [38],
- speed: 1
- },
- achievelk: {
- frames: [36],
- speed: 1
- },
- DYNAMIC_BOX_TYPE: {
- frames: [82],
- speed: 1
- },
- HARD_TRIANGLE_TYPE: {
- frames: [71],
- speed: 1
- },
- smallbg: {
- frames: [313],
- speed: 1
- },
- LAND_TYPE_4: {
- frames: [63],
- speed: 1
- },
- lvlnum7: {
- frames: [143],
- speed: 1
- },
- FAN_TYPE: {
- frames: [308],
- speed: 1
- },
- GLASS_TRIANGLE_TYPE: {
- frames: [80],
- speed: 1
- },
- BONUS_MONEY_TYPE: {
- frames: [87],
- speed: 1
- },
- completestar: {
- frames: [24, 24],
- speed: 1
- },
- lvlnum8: {
- frames: [144],
- speed: 1
- }
- }
- },
- interfaceCFG = {},
- bgCFG = {
- framerate: 24,
- images: ["assets/cheapbg.jpg"],
- frames: [
- [0, 270, 401, 270, 0, 0, 0],
- [401, 270, 401, 270, 0, 0, 0],
- [0, 540, 401, 270, 0, 0, 0],
- [401, 0, 401, 270, 0, 0, 0],
- [0, 0, 401, 270, 0, 0, 0]
- ],
- animations: {
- bigbg: {
- speed: 1,
- frames: [0, 1, 2, 3, 4]
- }
- }
- },
- PART_STAR_TYPE = 1,
- PART_CLOUD_TYPE = 2,
- PART_NUM_TYPE = 3,
- PART_INSTRUCTION_TYPE = 4,
- PART_GLASS_TYPE = 5,
- PART_ACHIEV_TYPE = 6,
- MAX_PARTICLES_ON_SCREEN = 12;
- (function (c) {
- function a(a, b, c) {
- this.initialize(a, b, c)
- }
- var b = a.prototype;
- b.initialize = function (a, b, c) {
- var e = new createjs.Sprite(zoeSS);
- e.snapToPixel = !0;
- e.baseBlock = this;
- this.vis = e;
- this.reset(a, b, c)
- };
- b.reset = function (a, b, c) {
- this.type = a;
- this.vis.parent != b && removeFromParent(this.vis);
- createjs.Tween.removeTweens(this.vis);
- this.parent = b;
- this.vis.alpha = 1;
- this.vis.mouseEnabled = !1;
- this.speedY = this.speedX = 0;
- this.moveTarget = null;
- this.speedA = 0;
- this.speedScale = 0.05;
- this.maxScale = 1.2;
- this.isPrerendered = !1;
- this.speedAlpha =
- 0.08;
- this.gravity = 0.6;
- this.isNum = !1;
- this.beforeHideTimer = 0.1;
- this.isNeedDispose = this.isInstruction = !1;
- this.vis.spriteSheet = zoeSS;
- deleteCache(this.vis);
- var e = "numb0";
- a == PART_STAR_TYPE ? e = 0.7 < Math.random() ? "particle1v" : 0.5 < Math.random() ? "particle3v" : "particle2v" : a == PART_NUM_TYPE || a == PART_ACHIEV_TYPE ? this.isNum = !0 : a == PART_CLOUD_TYPE ? (this.gravity = 0, e = 0.5 < Math.random() ? "cloud1v" : "cloud2v") : a == PART_INSTRUCTION_TYPE ? this.isInstruction = !0 : a === PART_GLASS_TYPE && (e = 0.7 < Math.random() ? "particleglass1" : 0.5 < Math.random() ?
- "particleglass2" : "particleglass3");
- this.vis.gotoAndStop(e);
- this.scale = c;
- this.updateVisionScale();
- b.addChild(this.vis)
- };
- b.setPos = function (a, b) {
- this.vis.x = a;
- this.vis.y = b
- };
- b.setNum = function (a) {
- this.beforeHideTimer = 10;
- this.speedAlpha = 0.03;
- this.gravity = 0;
- this.vis.rotation = 0;
- this.vis.gotoAndStop("PART_" + a)
- };
- b.setFrame = function (a, b) {
- this.gravity = 0;
- this.vis.rotation = 0;
- b ? this.vis.gotoAndPlay(a) : this.vis.gotoAndStop(a)
- };
- b.tick = function () {
- if (!(this.isNeedDispose || (this.moveTarget ? (this.vis.x = this.moveTarget.x,
- this.vis.y = this.moveTarget.y) : (this.vis.x += this.speedX * dtScale, this.vis.y += this.speedY * dtScale, this.speedY += this.gravity * dtScale, this.vis.rotation += this.speedA * dtScale), this.beforeHideTimer -= dtScale, 0 < this.beforeHideTimer)))
- if (this.isPrerendered) this.isNeedDispose = !0;
- else {
- if (this.isNum) this.vis.alpha -= this.speedAlpha * dtScale;
- else {
- if (this.isInstruction) return;
- this.vis.visible = !0;
- this.vis.scaleX += this.speedScale * dtScale;
- this.vis.scaleX > this.maxScale && (this.vis.alpha -= this.speedAlpha * dtScale);
- this.vis.scaleY =
- this.vis.scaleX
- }
- 0.01 > this.vis.alpha && (this.isNeedDispose = !0)
- }
- };
- b.updateVisionScale = function () {
- this.vis.scaleX = this.vis.scaleY = this.scale
- };
- b.dispose = function () {
- isArrayContains(allParts, this) && allParts.splice(allParts.indexOf(this, 0), 1);
- addToDisposedParts(this);
- this.vis.removeAllEventListeners();
- this.vis.stop();
- removeFromParent(this.vis)
- };
- c.ParticleBase = a
- })(window);
- var allParts = [],
- disposedParts = [];
- function initParticleManager() {
- container.addChild(particleContainer)
- }
- var partSin, partCos, partScale;
- function createPartExplode(c, a, b, g, f, d) {
- for (var e, h = 0; h < b; h++) {
- e = h * (2 * Math.PI / b);
- partSin = Math.cos(e);
- partCos = Math.sin(e);
- e = createPart(g, c, a, 1, f ? f : particleContainer);
- if (!e) break;
- setParticleParamsByIndex(e, d ? d : 0)
- }
- }
- function setParticleParamsByIndex(c, a) {
- var b = 1.3;
- c.gravity = 0;
- c.speedA = 20 * Math.random();
- 0 === a ? (c.maxScale = 0.7, c.beforeHideTimer = 0.2 * FPS, partScale = 0.2 + 0.2 * Math.random()) : 1 === a ? (b = 4, c.maxScale = 1.3, c.beforeHideTimer = 0.3 * FPS, c.gravity = 0, c.speedAlpha = 0.05, c.speedA = 20 * Math.random(), partScale = 0.4 + 0.6 * Math.random()) : 2 === a ? (b = 2, c.maxScale = 1.3, c.vis.alpha = 1, c.beforeHideTimer = 0.3 * FPS, c.speedA = 20 * Math.random(), partScale = 0.4 + 0.6 * Math.random()) : 3 === a && (b = 1.3, c.gravity = 0, c.speedA = 20 * Math.random(), c.maxScale = 0.7,
- c.beforeHideTimer = 0.1 * FPS, c.gravity = 0, c.speedAlpha = 0.05, partScale = 0.6, c.vis.alpha = 1);
- c.vis.scaleX = c.vis.scaleY = partScale;
- c.speedX = (b + Math.random() * b) * partCos;
- c.speedY = (b + Math.random() * b) * partSin
- }
- function createDiePart(c, a) {
- var b = createPart(PART_NUM_TYPE, c, a, 1, particleContainer);
- b && (b.setNum(11), b.setFrame("deathanimv", !0), b.speedAlpha = 0.05, b.beforeHideTimer = 1.5 * FPS, b.speedX = 0, b.speedY = -1, b.speedA = 0)
- }
- function createGoodPlayExplode(c, a) {
- for (var b, g = 0 == a ? 90 : -120, f = 0; 8 > f; f++) {
- var d = f * (Math.PI / 2 / 8) - Math.PI / 4;
- 0 < a && (d += Math.PI);
- var e = Math.cos(d),
- d = Math.sin(d);
- b = 0.2 + 0.2 * Math.random();
- b = createPart(PART_STAR_TYPE, g, 0, b, monsterCont);
- if (!b) break;
- b.setFrame("particle1v");
- b.speedAlpha = 0.1;
- b.speedScale = 0.02;
- b.vis.visible = !1;
- b.beforeHideTimer = 0.5 * FPS;
- b.maxScale = 0.6;
- b.speedX = (1.5 + 1.5 * Math.random()) * e;
- b.speedY = (1.5 + 1.5 * Math.random()) * d;
- b.speedA = 20 * Math.random()
- }
- }
- function createNumPart(c, a, b) {
- if (c = createPart(PART_NUM_TYPE, c, a, 0.8, particleContainer)) c.setNum(b), c.beforeHideTimer = 0.2 * FPS, c.speedX = 0, c.speedY = -0.8, c.speedA = 0
- }
- function createPrerenderedPart(c, a, b, g, f, d, e) {
- if (c = createPart(PART_NUM_TYPE, c, a, b, particleContainer)) c.setFrame(g, !0), setNextAnimation(c.vis, ""), e && setAnimationSpeed(c.vis, e), c.isPrerendered = !0, d && (c.moveTarget = d), c.beforeHideTimer = f * GAME_FPS, c.speedX = 0, c.speedY = 0, c.speedA = 0, c.gravity = 0, c.vis.rotation = 0
- }
- function createGlassRectExplode(c, a, b, g) {
- for (var f, d = 0; 5 > d; d++) {
- var e = g * Math.PI / 180;
- f = Math.cos(e);
- var e = Math.sin(e),
- h = (24.4 * d - 60) * b;
- f = createPart(PART_GLASS_TYPE, c + h * f, a + h * e, 1, particleContainer);
- if (!f) break;
- f.gravity = 0;
- f.speedA = 20 * Math.random();
- f.maxScale = 0.7;
- f.beforeHideTimer = 0.1 * FPS;
- f.gravity = 0;
- f.speedAlpha = 0.05;
- partScale = 0.6;
- f.vis.scaleX = f.vis.scaleY = partScale;
- f.speedX = 1.3 - 2.6 * Math.random();
- f.speedY = 1.3 - 2.6 * Math.random()
- }
- }
- function createAwesomePart() {
- var c = createPart(PART_NUM_TYPE, 160, topVisionLine + viewportH / 2, 1, particleContainer);
- c && (c.setNum(11), c.speedAlpha = 1, c.beforeHideTimer = 1.5 * FPS, c.speedX = 0, c.speedY = 0, c.speedA = 0, c.vis.rotation = -360, c.vis.scaleX = c.vis.scaleY = 0.1, createjs.Tween.get(c.vis, {
- override: !0
- })
- .to({
- rotation: 0,
- scaleX: 1,
- scaleY: 1
- }, 600)
- .wait(600)
- .to({
- alpha: 0
- }, 200))
- }
- function createAchievPart(c) {
- for (var a = 210, b = 10, g = 0, f, d = 0; d < allParts.length; d++) f = allParts[d], f.type === PART_ACHIEV_TYPE && (a = f.vis.y - 50, b += 200, g++);
- if (f = createPart(PART_ACHIEV_TYPE, -130, a, 0.8, container)) f.setFrame("achievdesc" + c), f.speedAlpha = 1, f.beforeHideTimer = 3.2 * FPS + 0.2 * g, f.speedX = 0, f.speedY = 0, f.speedA = 0, f.vis.rotation = 0, f.vis.scaleX = f.vis.scaleY = 0.7, f.vis.alpha = 1, createjs.Tween.get(f.vis, {
- override: !0
- })
- .wait(b)
- .to({
- x: 5
- }, 600, menuEase)
- .wait(2E3)
- .to({
- x: -130
- }, 400, createjs.Ease.sineIn)
- }
- var allPartsLenght = 0;
- function createPart(c, a, b, g, f) {
- var d;
- allPartsLenght = allParts.length;
- if (allPartsLenght > MAX_PARTICLES_ON_SCREEN) {
- for (var e = 0; e < allPartsLenght; e++)
- if (allParts[e].type === PART_STAR_TYPE) {
- d = allParts[e];
- break
- }
- d || (d = allParts[0]);
- d.reset(c, f, g)
- } else d = gePartFromPool(c, f, g);
- d.setPos(a, b);
- isArrayContains(allParts, d) || allParts.push(d);
- return d
- }
- function addToDisposedParts(c) {
- isArrayContains(disposedParts, c) || disposedParts.push(c)
- }
- function gePartFromPool(c, a, b) {
- if (0 < disposedParts.length) {
- var g = disposedParts.pop();
- g.reset(c, a, b);
- return g
- }
- return new ParticleBase(c, a, b)
- }
- var partLength = 0,
- currPart = null,
- disposeNeededParts = [];
- function updatePartManager() {
- partLength = allParts.length;
- for (var c = 0; c < partLength; c++) currPart = allParts[c], currPart.tick(), currPart.isNeedDispose && disposeNeededParts.push(currPart);
- for (; 0 < disposeNeededParts.length;) disposeNeededParts.pop()
- .dispose()
- }
- (function () {
- Object.create = Object.create || function (a) {
- function b() {}
- return b.prototype = a, new b
- };
- var c;
- "undefined" == typeof exports ? (c = {}, "object" == typeof window && (window.cp = c)) : c = exports;
- var a, b, g = function (a, b) {
- if (!a) throw Error("Assertion failed: " + b);
- },
- f = function (a, b) {
- !a && console && console.warn && (console.warn("ASSERTION FAILED: " + b), console.trace && console.trace())
- },
- d = function (a, b) {
- return b > a ? a : b
- },
- e = function (a, b) {
- return a > b ? a : b
- };
- "object" == typeof window && -1 < window.navigator.userAgent.indexOf("Firefox") ?
- (a = Math.min, b = Math.max) : (a = d, b = e);
- var h = function (a, b) {
- return b > a ? a + " " + b : b + " " + a
- },
- k = function (a, b) {
- for (var c = 0; a.length > c; c++)
- if (a[c] === b) return a[c] = a[a.length - 1], a.length--, void 0
- };
- c.momentForCircle = function (a, b, c, d) {
- return a * (0.5 * (b * b + c * c) + N(d))
- };
- c.areaForCircle = function (a, b) {
- return Math.PI * Math.abs(a * a - b * b)
- };
- c.momentForSegment = function (a, b, c) {
- var d = z(A(b, c), 0.5);
- return a * (Ka(c, b) / 12 + N(d))
- };
- c.areaForSegment = function (a, b, c) {
- return c * (Math.PI * c + 2 * sa(a, b))
- };
- c.momentForPoly = function (a, b, c) {
- for (var d =
- 0, e = 0, f = b.length, g = 0; f > g; g += 2) var h = b[g] + c.x,
- k = b[g + 1] + c.y,
- m = b[(g + 2) % f] + c.x,
- n = b[(g + 3) % f] + c.y,
- q = m * k - n * h,
- d = d + q * (h * h + k * k + (h * m + k * n) + (m * m + n * n)),
- e = e + q;
- return a * d / (6 * e)
- };
- c.areaForPoly = function (a) {
- for (var b = 0, c = 0, d = a.length; d > c; c += 2) b += F(new q(a[c], a[c + 1]), new q(a[(c + 2) % d], a[(c + 3) % d]));
- return -b / 2
- };
- c.centroidForPoly = function (a) {
- for (var b = 0, c = new q(0, 0), d = 0, e = a.length; e > d; d += 2) var f = new q(a[d], a[d + 1]),
- g = new q(a[(d + 2) % e], a[(d + 3) % e]),
- h = F(f, g),
- b = b + h,
- c = A(c, z(A(f, g), h));
- return z(c, 1 / (3 * b))
- };
- c.recenterPoly = function (a) {
- for (var b =
- c.centroidForPoly(a), d = 0; a.length > d; d += 2) a[d] -= b.x, a[d + 1] -= b.y
- };
- c.momentForBox = function (a, b, c) {
- return a * (b * b + c * c) / 12
- };
- c.momentForBox2 = function (a, b) {
- var d = b.r - b.l,
- e = b.t - b.b,
- f = z([b.l + b.r, b.b + b.t], 0.5);
- return c.momentForBox(a, d, e) + a * N(f)
- };
- var m = c.loopIndexes = function (a) {
- var b, c, d, e, f = 0,
- g = 0;
- b = d = a[0];
- c = e = a[1];
- for (var h = a.length >> 1, k = 1; h > k; k++) {
- var m = a[2 * k],
- n = a[2 * k + 1];
- b > m || m == b && c > n ? (b = m, c = n, f = k) : (m > d || m == d && n > e) && (d = m, e = n, g = k)
- }
- return [f, g]
- },
- n = function (a, b, c) {
- var d = a[2 * b];
- a[2 * b] = a[2 * c];
- a[2 * c] = d;
- d = a[2 * b +
- 1];
- a[2 * b + 1] = a[2 * c + 1];
- a[2 * c + 1] = d
- },
- p = function (a, b, c, d, e, f) {
- if (0 === c) return 0;
- var g = 0,
- h = b;
- e = y(e, d);
- f *= x(e);
- var k = b;
- for (c = b + c - 1; c >= k;) {
- var m = new q(a[2 * k], a[2 * k + 1]),
- m = F(e, y(m, d));
- m > f ? (m > g && (g = m, h = k), k++) : (n(a, k, c), c--)
- }
- return h != b && n(a, b, h), k - b
- },
- r = function (a, b, c, d, e, f, g, h) {
- if (0 > d) return 0;
- if (0 == d) return b[2 * h] = f.x, b[2 * h + 1] = f.y, 1;
- var k = p(b, c, d, e, f, a),
- m = new q(b[2 * c], b[2 * c + 1]);
- e = r(a, b, c + 1, k - 1, e, m, f, h);
- m = h + e++;
- b[2 * m] = f.x;
- b[2 * m + 1] = f.y;
- d = p(b, c + k, d - k, f, g, a);
- m = new q(b[2 * (c + k)], b[2 * (c + k) + 1]);
- return e + r(a, b, c + k +
- 1, d - 1, f, m, g, h + e)
- };
- c.convexHull = function (a, b, c) {
- if (b)
- for (var d = 0; a.length > d; d++) b[d] = a[d];
- else b = a;
- var e = m(a),
- d = e[0],
- e = e[1];
- if (d == e) return b.length = 2, b;
- n(b, 0, d);
- n(b, 1, 0 == e ? d : e);
- d = new q(b[0], b[1]);
- e = new q(b[2], b[3]);
- a = r(c, b, 2, (a.length >> 1) - 2, d, e, d, 1) + 1;
- return b.length = 2 * a, f(Ma(b), "Internal error: cpConvexHull() and cpPolyValidate() did not agree.Please report this error with as much info as you can."), b
- };
- var s = function (c, d, e) {
- return a(b(c, d), e)
- },
- t = function (c) {
- return b(0, a(c, 1))
- },
- q = c.Vect = function (a,
- b) {
- this.x = a;
- this.y = b
- };
- c.v = function (a, b) {
- return new q(a, b)
- };
- var w = c.vzero = new q(0, 0),
- u = c.v.dot = function (a, b) {
- return a.x * b.x + a.y * b.y
- },
- x = c.v.len = function (a) {
- return Math.sqrt(u(a, a))
- },
- K = c.v.len2 = function (a, b) {
- return Math.sqrt(a * a + b * b)
- };
- c.v.eql = function (a, b) {
- return a.x === b.x && a.y === b.y
- };
- var A = c.v.add = function (a, b) {
- return new q(a.x + b.x, a.y + b.y)
- };
- q.prototype.add = function (a) {
- return this.x += a.x, this.y += a.y, this
- };
- var y = c.v.sub = function (a, b) {
- return new q(a.x - b.x, a.y - b.y)
- };
- q.prototype.sub = function (a) {
- return this.x -=
- a.x, this.y -= a.y, this
- };
- var C = c.v.neg = function (a) {
- return new q(-a.x, -a.y)
- };
- q.prototype.neg = function () {
- return this.x = -this.x, this.y = -this.y, this
- };
- var z = c.v.mult = function (a, b) {
- return new q(a.x * b, a.y * b)
- };
- q.prototype.mult = function (a) {
- return this.x *= a, this.y *= a, this
- };
- var F = c.v.cross = function (a, b) {
- return a.x * b.y - a.y * b.x
- },
- J = c.v.perp = function (a) {
- return new q(-a.y, a.x)
- };
- c.v.pvrperp = function (a) {
- return new q(a.y, -a.x)
- };
- var P = c.v.project = function (a, b) {
- return z(b, u(a, b) / N(b))
- };
- q.prototype.project = function (a) {
- return this.mult(u(this,
- a) / N(a)), this
- };
- var E = c.v.rotate = function (a, b) {
- return new q(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x)
- };
- q.prototype.rotate = function (a) {
- return this.x = this.x * a.x - this.y * a.y, this.y = this.x * a.y + this.y * a.x, this
- };
- var S = c.v.unrotate = function (a, b) {
- return new q(a.x * b.x + a.y * b.y, a.y * b.x - a.x * b.y)
- },
- N = c.v.lengthsq = function (a) {
- return u(a, a)
- },
- Z = c.v.lengthsq2 = function (a, b) {
- return a * a + b * b
- },
- T = c.v.lerp = function (a, b, c) {
- return A(z(a, 1 - c), z(b, c))
- },
- Q = c.v.normalize = function (a) {
- return z(a, 1 / x(a))
- },
- G = c.v.normalize_safe = function (a) {
- return 0 ===
- a.x && 0 === a.y ? w : Q(a)
- },
- M = c.v.clamp = function (a, b) {
- return u(a, a) > b * b ? z(Q(a), b) : a
- };
- c.v.lerpconst = function (a, b, c) {
- return A(a, M(y(b, a), c))
- };
- var sa = c.v.dist = function (a, b) {
- return x(y(a, b))
- },
- Ka = c.v.distsq = function (a, b) {
- return N(y(a, b))
- };
- c.v.near = function (a, b, c) {
- return c * c > Ka(a, b)
- };
- var eb = c.v.slerp = function (a, b, c) {
- var d = Math.acos(u(a, b));
- if (d) {
- var e = 1 / Math.sin(d);
- return A(z(a, Math.sin((1 - c) * d) * e), z(b, Math.sin(c * d) * e))
- }
- return a
- };
- c.v.slerpconst = function (b, c, d) {
- var e = Math.acos(u(b, c));
- return eb(b, c, a(d, e) / e)
- };
- c.v.forangle = function (a) {
- return new q(Math.cos(a), Math.sin(a))
- };
- c.v.toangle = function (a) {
- return Math.atan2(a.y, a.x)
- };
- c.v.str = function (a) {
- return "(" + a.x.toFixed(3) + ", " + a.y.toFixed(3) + ")"
- };
- var fb = 0,
- $ = c.BB = function (a, b, c, d) {
- this.l = a;
- this.b = b;
- this.r = c;
- this.t = d;
- fb++
- };
- c.bb = function (a, b, c, d) {
- return new $(a, b, c, d)
- };
- var La = 0;
- c.NO_GROUP = 0;
- var gb = c.ALL_LAYERS = -1;
- c.resetShapeIdCounter = function () {
- La = 0
- };
- var O = c.Shape = function (a) {
- this.body = a;
- this.bb_l = this.bb_b = this.bb_r = this.bb_t = 0;
- this.hashid = La++;
- this.sensor = !1;
- this.u = this.e = 0;
- this.surface_v = w;
- this.group = this.collision_type = 0;
- this.layers = gb;
- this.space = null;
- this.collisionCode = this.collisionCode
- };
- O.prototype.setElasticity = function (a) {
- this.e = a
- };
- O.prototype.setFriction = function (a) {
- this.body.activate();
- this.u = a
- };
- O.prototype.setLayers = function (a) {
- this.body.activate();
- this.layers = a
- };
- O.prototype.setSensor = function (a) {
- this.body.activate();
- this.sensor = a
- };
- O.prototype.setCollisionType = function (a) {
- this.body.activate();
- this.collision_type = a
- };
- O.prototype.getBody = function () {
- return this.body
- };
- O.prototype.active = function () {
- return this.body && -1 !== this.body.shapeList.indexOf(this)
- };
- O.prototype.setBody = function (a) {
- g(!this.active(), "You cannot change the body on an active shape. You must remove the shape from the space before changing the body.");
- this.body = a
- };
- O.prototype.cacheBB = function () {
- return this.update(this.body.p, this.body.rot)
- };
- O.prototype.update = function (a, b) {
- g(!isNaN(b.x), "Rotation is NaN");
- g(!isNaN(a.x), "Position is NaN");
- this.cacheData(a, b)
- };
- O.prototype.pointQuery = function (a) {
- a =
- this.nearestPointQuery(a);
- return 0 > a.d ? a : void 0
- };
- O.prototype.getBB = function () {
- return new $(this.bb_l, this.bb_b, this.bb_r, this.bb_t)
- };
- var ta = function (a, b, c) {
- this.shape = a;
- this.p = b;
- this.d = c
- },
- ha = function (a, b, c) {
- this.shape = a;
- this.t = b;
- this.n = c
- };
- ha.prototype.hitPoint = function (a, b) {
- return T(a, b, this.t)
- };
- ha.prototype.hitDist = function (a, b) {
- return sa(a, b) * this.t
- };
- var fa = c.CircleShape = function (a, b, c) {
- this.c = this.tc = c;
- this.r = b;
- this.type = "circle";
- O.call(this, a)
- };
- fa.prototype = Object.create(O.prototype);
- fa.prototype.cacheData =
- function (a, b) {
- var c = this.tc = E(this.c, b)
- .add(a),
- d = this.r;
- this.bb_l = c.x - d;
- this.bb_b = c.y - d;
- this.bb_r = c.x + d;
- this.bb_t = c.y + d
- };
- fa.prototype.nearestPointQuery = function (a) {
- var b = a.x - this.tc.x,
- c = a.y - this.tc.y;
- a = K(b, c);
- var d = this.r,
- b = new q(this.tc.x + b * d / a, this.tc.y + c * d / a);
- return new ta(this, b, a - d)
- };
- var ua = function (a, b, c, d, e) {
- d = y(d, b);
- e = y(e, b);
- b = u(d, d) - 2 * u(d, e) + u(e, e);
- var f = -2 * u(d, d) + 2 * u(d, e);
- c = u(d, d) - c * c;
- c = f * f - 4 * b * c;
- if (0 <= c && (b = (-f - Math.sqrt(c)) / (2 * b), 0 <= b && 1 >= b)) return new ha(a, b, Q(T(d, e, b)))
- };
- fa.prototype.segmentQuery =
- function (a, b) {
- return ua(this, this.tc, this.r, a, b)
- };
- var ba = c.SegmentShape = function (a, b, c, d) {
- this.a = b;
- this.b = c;
- this.n = J(Q(y(c, b)));
- this.ta = this.tb = this.tn = null;
- this.r = d;
- this.b_tangent = this.a_tangent = w;
- this.type = "segment";
- O.call(this, a)
- };
- ba.prototype = Object.create(O.prototype);
- ba.prototype.cacheData = function (a, b) {
- this.ta = A(a, E(this.a, b));
- this.tb = A(a, E(this.b, b));
- this.tn = E(this.n, b);
- var c, d, e, f;
- this.ta.x < this.tb.x ? (c = this.ta.x, d = this.tb.x) : (c = this.tb.x, d = this.ta.x);
- this.ta.y < this.tb.y ? (e = this.ta.y, f = this.tb.y) :
- (e = this.tb.y, f = this.ta.y);
- var g = this.r;
- this.bb_l = c - g;
- this.bb_b = e - g;
- this.bb_r = d + g;
- this.bb_t = f + g
- };
- ba.prototype.nearestPointQuery = function (a) {
- var b;
- b = this.tb;
- var c = y(this.ta, b),
- d = t(u(c, y(a, b)) / N(c));
- b = A(b, z(c, d));
- var c = a.x - b.x,
- e = a.y - b.y;
- a = K(c, e);
- d = this.r;
- b = a ? A(b, z(new q(c, e), d / a)) : b;
- return new ta(this, b, a - d)
- };
- ba.prototype.segmentQuery = function (a, b) {
- var c = this.tn,
- d = u(y(this.ta, a), c),
- e = this.r,
- f = 0 < d ? C(c) : c,
- g = y(z(f, e), a),
- h = A(this.ta, g),
- k = A(this.tb, g),
- g = y(b, a);
- if (0 >= F(g, h) * F(g, k)) {
- if (e = d + (0 < d ? -e : e), d = -e,
- c = u(g, c) - e, 0 > d * c) return new ha(this, d / (d - c), f)
- } else if (0 !== e) return f = ua(this, this.ta, this.r, a, b), c = ua(this, this.tb, this.r, a, b), f ? c && c.t < f.t ? c : f : c
- };
- ba.prototype.setNeighbors = function (a, b) {
- this.a_tangent = y(a, this.a);
- this.b_tangent = y(b, this.b)
- };
- ba.prototype.setEndpoints = function (a, b) {
- this.a = a;
- this.b = b;
- this.n = J(Q(y(b, a)))
- };
- var Ma = function (a) {
- for (var b = a.length, c = 0; b > c; c += 2) {
- var d = a[(c + 2) % b],
- e = a[(c + 3) % b];
- if (0 < (d - a[c]) * (a[(c + 5) % b] - e) - (e - a[c + 1]) * (a[(c + 4) % b] - d)) return !1
- }
- return !0
- },
- R = c.PolyShape = function (a,
- b, c) {
- this.setVerts(b, c);
- this.type = "poly";
- O.call(this, a)
- };
- R.prototype = Object.create(O.prototype);
- var va = function (a, b) {
- this.n = a;
- this.d = b
- };
- va.prototype.compare = function (a) {
- return u(this.n, a) - this.d
- };
- R.prototype.setVerts = function (a, b) {
- g(4 <= a.length, "Polygons require some verts");
- g("number" == typeof a[0], "Polygon verticies should be specified in a flattened list (eg [x1,y1,x2,y2,x3,y3,...])");
- g(Ma(a), "Polygon is concave or has a reversed winding. Consider using cpConvexHull()");
- var c = a.length,
- d = c >> 1;
- this.verts =
- Array(c);
- this.tVerts = Array(c);
- this.planes = Array(d);
- this.tPlanes = Array(d);
- for (d = 0; c > d; d += 2) {
- var e = a[d] + b.x,
- f = a[d + 1] + b.y,
- h = Q(J(new q(a[(d + 2) % c] + b.x - e, a[(d + 3) % c] + b.y - f)));
- this.verts[d] = e;
- this.verts[d + 1] = f;
- this.planes[d >> 1] = new va(h, h.x * e + h.y * f);
- this.tPlanes[d >> 1] = new va(new q(0, 0), 0)
- }
- };
- c.BoxShape = function (a, b, c) {
- b /= 2;
- c /= 2;
- return hb(a, new $(-b, -c, b, c))
- };
- var hb = c.BoxShape2 = function (a, b) {
- return new R(a, [b.l, b.b, b.l, b.t, b.r, b.t, b.r, b.b], w)
- };
- R.prototype.transformVerts = function (c, d) {
- for (var e = this.verts, f =
- this.tVerts, g = 1 / 0, h = -1 / 0, k = 1 / 0, m = -1 / 0, n = 0; e.length > n; n += 2) {
- var q = e[n],
- p = e[n + 1],
- r = c.x + q * d.x - p * d.y,
- q = c.y + q * d.y + p * d.x;
- f[n] = r;
- f[n + 1] = q;
- g = a(g, r);
- h = b(h, r);
- k = a(k, q);
- m = b(m, q)
- }
- this.bb_l = g;
- this.bb_b = k;
- this.bb_r = h;
- this.bb_t = m
- };
- R.prototype.transformAxes = function (a, b) {
- for (var c = this.planes, d = this.tPlanes, e = 0; c.length > e; e++) {
- var f = E(c[e].n, b);
- d[e].n = f;
- d[e].d = u(a, f) + c[e].d
- }
- };
- R.prototype.cacheData = function (a, b) {
- this.transformAxes(a, b);
- this.transformVerts(a, b)
- };
- R.prototype.nearestPointQuery = function (a) {
- for (var b =
- this.tPlanes, c = this.tVerts, d = c[c.length - 2], e = c[c.length - 1], f = 1 / 0, g = w, h = !1, k = 0; b.length > k; k++) {
- 0 < b[k].compare(a) && (h = !0);
- var m = c[2 * k],
- n = c[2 * k + 1],
- p;
- p = m;
- var r = n,
- d = d - p,
- e = e - r,
- s = t((d * (a.x - p) + e * (a.y - r)) / Z(d, e));
- p = new q(p + d * s, r + e * s);
- r = sa(a, p);
- f > r && (f = r, g = p);
- d = m;
- e = n
- }
- return new ta(this, g, h ? f : -f)
- };
- R.prototype.segmentQuery = function (a, b) {
- for (var c = this.tPlanes, d = this.tVerts, e = c.length, f = 2 * e, g = 0; e > g; g++) {
- var h = c[g].n,
- k = u(a, h);
- if (!(c[g].d > k)) {
- var m = u(b, h),
- k = (c[g].d - k) / (m - k);
- if (!(0 > k || 1 < k)) {
- var m = T(a, b, k),
- m = -F(h,
- m),
- n = -(h.x * d[(2 * g + 3) % f] - h.y * d[(2 * g + 2) % f]);
- if (m >= -(h.x * d[2 * g + 1] - h.y * d[2 * g]) && n >= m) return new ha(this, k, h)
- }
- }
- }
- };
- R.prototype.valueOnAxis = function (b, c) {
- for (var d = this.tVerts, e = b.x * d[0] + b.y * d[1], f = 2; d.length > f; f += 2) e = a(e, b.x * d[f] + b.y * d[f + 1]);
- return e - c
- };
- R.prototype.containsVert = function (a, b) {
- for (var c = this.tPlanes, d = 0; c.length > d; d++) {
- var e = c[d].n;
- if (0 < e.x * a + e.y * b - c[d].d) return !1
- }
- return !0
- };
- R.prototype.containsVertPartial = function (a, b, c) {
- for (var d = this.tPlanes, e = 0; d.length > e; e++) {
- var f = d[e].n;
- if (!(0 > u(f,
- c)) && 0 < f.x * a + f.y * b - d[e].d) return !1
- }
- return !0
- };
- R.prototype.getNumVerts = function () {
- return this.verts.length / 2
- };
- R.prototype.getVert = function (a) {
- return new q(this.verts[2 * a], this.verts[2 * a + 1])
- };
- var D = c.Body = function (a, b) {
- this.p = new q(0, 0);
- this.vx = this.vy = 0;
- this.f = new q(0, 0);
- this.t = this.w = 0;
- this.v_limit = 1 / 0;
- this.w_limit = 1 / 0;
- this.w_bias = this.v_biasx = this.v_biasy = 0;
- this.space = null;
- this.shapeList = [];
- this.nodeNext = this.nodeRoot = this.constraintList = this.arbiterList = null;
- this.nodeIdleTime = 0;
- this.setMass(a);
- this.setMoment(b);
- this.rot = new q(0, 0);
- this.setAngle(0)
- };
- if ("undefined" != typeof DEBUG && DEBUG) {
- var wa = function (a, b) {
- g(a.x == a.x && a.y == a.y, b)
- },
- xa = function (a, b) {
- g(1 / 0 !== Math.abs(a.x) && 1 / 0 !== Math.abs(a.y), b)
- };
- D.prototype.sanityCheck = function () {
- g(this.m === this.m && this.m_inv === this.m_inv, "Body's mass is invalid.");
- g(this.i === this.i && this.i_inv === this.i_inv, "Body's moment is invalid.");
- var a = this.p;
- wa(a, "Body's position is invalid.");
- xa(a, "Body's position is invalid.");
- a = this.f;
- wa(a, "Body's force is invalid.");
- xa(a, "Body's force is invalid.");
- g(this.vx === this.vx && 1 / 0 !== Math.abs(this.vx), "Body's velocity is invalid.");
- g(this.vy === this.vy && 1 / 0 !== Math.abs(this.vy), "Body's velocity is invalid.");
- g(this.a === this.a && 1 / 0 !== Math.abs(this.a), "Body's angle is invalid.");
- g(this.w === this.w && 1 / 0 !== Math.abs(this.w), "Body's angular velocity is invalid.");
- g(this.t === this.t && 1 / 0 !== Math.abs(this.t), "Body's torque is invalid.");
- a = this.rot;
- wa(a, "Body's rotation vector is invalid.");
- xa(a, "Body's rotation vector is invalid.");
- g(this.v_limit === this.v_limit,
- "Body's velocity limit is invalid.");
- g(this.w_limit === this.w_limit, "Body's angular velocity limit is invalid.")
- }
- } else D.prototype.sanityCheck = function () {};
- D.prototype.getPos = function () {
- return this.p
- };
- D.prototype.getVel = function () {
- return new q(this.vx, this.vy)
- };
- D.prototype.getAngVel = function () {
- return this.w
- };
- D.prototype.isSleeping = function () {
- return null !== this.nodeRoot
- };
- D.prototype.isStatic = function () {
- return 1 / 0 === this.nodeIdleTime
- };
- D.prototype.isRogue = function () {
- return null === this.space
- };
- D.prototype.setMass =
- function (a) {
- g(0 < a, "Mass must be positive and non-zero.");
- this.activate();
- this.m = a;
- this.m_inv = 1 / a
- };
- D.prototype.setMoment = function (a) {
- g(0 < a, "Moment of Inertia must be positive and non-zero.");
- this.activate();
- this.i = a;
- this.i_inv = 1 / a
- };
- D.prototype.addShape = function (a) {
- this.shapeList.push(a)
- };
- D.prototype.removeShape = function (a) {
- k(this.shapeList, a)
- };
- var ya = function (a, b, c) {
- return a === c ? a.next(b) : (a.a === b ? a.next_a = ya(a.next_a, b, c) : a.next_b = ya(a.next_b, b, c), a)
- };
- D.prototype.removeConstraint = function (a) {
- this.constraintList =
- ya(this.constraintList, this, a)
- };
- D.prototype.setPos = function (a) {
- this.activate();
- this.sanityCheck();
- a === w && (a = c.v(0, 0));
- this.p = a
- };
- D.prototype.setVel = function (a) {
- this.activate();
- this.vx = a.x;
- this.vy = a.y
- };
- D.prototype.setAngVel = function (a) {
- this.activate();
- this.w = a
- };
- D.prototype.setAngleInternal = function (a) {
- g(!isNaN(a), "Internal Error: Attempting to set body's angle to NaN");
- this.a = a;
- this.rot.x = Math.cos(a);
- this.rot.y = Math.sin(a)
- };
- D.prototype.setAngle = function (a) {
- this.activate();
- this.sanityCheck();
- this.setAngleInternal(a)
- };
- D.prototype.velocity_func = function (a, b, c) {
- var d = this.vx * b + (a.x + this.f.x * this.m_inv) * c;
- a = this.vy * b + (a.y + this.f.y * this.m_inv) * c;
- var e = this.v_limit,
- f = d * d + a * a,
- e = f > e * e ? e / Math.sqrt(f) : 1;
- this.vx = d * e;
- this.vy = a * e;
- d = this.w_limit;
- this.w = s(this.w * b + this.t * this.i_inv * c, -d, d);
- this.sanityCheck()
- };
- D.prototype.position_func = function (a) {
- this.p.x += (this.vx + this.v_biasx) * a;
- this.p.y += (this.vy + this.v_biasy) * a;
- this.setAngleInternal(this.a + (this.w + this.w_bias) * a);
- this.w_bias = this.v_biasx = this.v_biasy = 0;
- this.sanityCheck()
- };
- D.prototype.resetForces = function () {
- this.activate();
- this.f = new q(0, 0);
- this.t = 0
- };
- D.prototype.applyForce = function (a, b) {
- this.activate();
- this.f = A(this.f, a);
- this.t += F(b, a)
- };
- D.prototype.applyImpulse = function (a, b) {
- this.activate();
- za(this, a.x, a.y, b)
- };
- D.prototype.getVelAtPoint = function (a) {
- return A(new q(this.vx, this.vy), z(J(a), this.w))
- };
- D.prototype.getVelAtWorldPoint = function (a) {
- return this.getVelAtPoint(y(a, this.p))
- };
- D.prototype.getVelAtLocalPoint = function (a) {
- return this.getVelAtPoint(E(a, this.rot))
- };
- D.prototype.eachShape =
- function (a) {
- for (var b = 0, c = this.shapeList.length; c > b; b++) a(this.shapeList[b])
- };
- D.prototype.eachConstraint = function (a) {
- for (var b = this.constraintList; b;) {
- var c = b.next(this);
- a(b);
- b = c
- }
- };
- D.prototype.eachArbiter = function (a) {
- for (var b = this.arbiterList; b;) {
- var c = b.next(this);
- b.swappedColl = this === b.body_b;
- a(b);
- b = c
- }
- };
- D.prototype.local2World = function (a) {
- return A(this.p, E(a, this.rot))
- };
- D.prototype.world2Local = function (a) {
- return S(y(a, this.p), this.rot)
- };
- D.prototype.kineticEnergy = function () {
- var a = this.vx * this.vx +
- this.vy * this.vy,
- b = this.w * this.w;
- return (a ? a * this.m : 0) + (b ? b * this.i : 0)
- };
- var Aa = c.SpatialIndex = function (a) {
- if (this.staticIndex = a, a) {
- if (a.dynamicIndex) throw Error("This static index is already associated with a dynamic index.");
- a.dynamicIndex = this
- }
- };
- Aa.prototype.collideStatic = function (a, b) {
- if (0 < a.count) {
- var c = a.query;
- this.each(function (a) {
- c(a, new $(a.bb_l, a.bb_b, a.bb_r, a.bb_t), b)
- })
- }
- };
- var I = c.BBTree = function (a) {
- Aa.call(this, a);
- this.velocityFunc = null;
- this.leaves = {};
- this.count = 0;
- this.pooledPairs = this.pooledNodes =
- this.root = null;
- this.stamp = 0
- };
- I.prototype = Object.create(Aa.prototype);
- var ib = 0,
- W = function (c, d, e) {
- this.obj = null;
- this.bb_l = a(d.bb_l, e.bb_l);
- this.bb_b = a(d.bb_b, e.bb_b);
- this.bb_r = b(d.bb_r, e.bb_r);
- this.bb_t = b(d.bb_t, e.bb_t);
- this.parent = null;
- this.setA(d);
- this.setB(e)
- };
- I.prototype.makeNode = function (a, b) {
- var c = this.pooledNodes;
- return c ? (this.pooledNodes = c.parent, c.constructor(this, a, b), c) : (ib++, new W(this, a, b))
- };
- var jb = 0,
- X = function (a, b) {
- this.obj = b;
- a.getBB(b, this);
- this.parent = null;
- this.stamp = 1;
- this.pairs = null;
- jb++
- };
- I.prototype.getBB = function (c, d) {
- var e = this.velocityFunc;
- if (e) {
- var f = 0.1 * (c.bb_r - c.bb_l),
- g = 0.1 * (c.bb_t - c.bb_b),
- e = z(e(c), 0.1);
- d.bb_l = c.bb_l + a(-f, e.x);
- d.bb_b = c.bb_b + a(-g, e.y);
- d.bb_r = c.bb_r + b(f, e.x);
- d.bb_t = c.bb_t + b(g, e.y)
- } else d.bb_l = c.bb_l, d.bb_b = c.bb_b, d.bb_r = c.bb_r, d.bb_t = c.bb_t
- };
- I.prototype.getStamp = function () {
- var a = this.dynamicIndex;
- return a && a.stamp ? a.stamp : this.stamp
- };
- I.prototype.incrementStamp = function () {
- this.dynamicIndex && this.dynamicIndex.stamp ? this.dynamicIndex.stamp++ : this.stamp++
- };
- var kb = 0,
- Na = function (a, b, c, d) {
- this.prevA = null;
- this.leafA = a;
- this.nextA = b;
- this.prevB = null;
- this.leafB = c;
- this.nextB = d
- };
- I.prototype.makePair = function (a, b, c, d) {
- var e = this.pooledPairs;
- return e ? (this.pooledPairs = e.prevA, e.prevA = null, e.leafA = a, e.nextA = b, e.prevB = null, e.leafB = c, e.nextB = d, e) : (kb++, new Na(a, b, c, d))
- };
- Na.prototype.recycle = function (a) {
- this.prevA = a.pooledPairs;
- a.pooledPairs = this
- };
- var Oa = function (a, b, c) {
- c && (c.leafA === b ? c.prevA = a : c.prevB = a);
- a ? a.leafA === b ? a.nextA = c : a.nextB = c : b.pairs = c
- };
- X.prototype.clearPairs =
- function (a) {
- var b, c = this.pairs;
- for (this.pairs = null; c;) c.leafA === this ? (b = c.nextA, Oa(c.prevB, c.leafB, c.nextB)) : (b = c.nextB, Oa(c.prevA, c.leafA, c.nextA)), c.recycle(a), c = b
- };
- var Pa = function (a, b, c) {
- var d = a.pairs,
- e = b.pairs;
- c = c.makePair(a, d, b, e);
- a.pairs = b.pairs = c;
- d && (d.leafA === a ? d.prevA = c : d.prevB = c);
- e && (e.leafA === b ? e.prevA = c : e.prevB = c)
- };
- W.prototype.recycle = function (a) {
- this.parent = a.pooledNodes;
- a.pooledNodes = this
- };
- X.prototype.recycle = function () {};
- W.prototype.setA = function (a) {
- this.A = a;
- a.parent = this
- };
- W.prototype.setB =
- function (a) {
- this.B = a;
- a.parent = this
- };
- X.prototype.isLeaf = !0;
- W.prototype.isLeaf = !1;
- W.prototype.otherChild = function (a) {
- return this.A == a ? this.B : this.A
- };
- W.prototype.replaceChild = function (c, d, e) {
- f(c == this.A || c == this.B, "Node is not a child of parent.");
- this.A == c ? (this.A.recycle(e), this.setA(d)) : (this.B.recycle(e), this.setB(d));
- for (c = this; c; c = c.parent) d = c.A, e = c.B, c.bb_l = a(d.bb_l, e.bb_l), c.bb_b = a(d.bb_b, e.bb_b), c.bb_r = b(d.bb_r, e.bb_r), c.bb_t = b(d.bb_t, e.bb_t)
- };
- W.prototype.bbArea = X.prototype.bbArea = function () {
- return (this.bb_r -
- this.bb_l) * (this.bb_t - this.bb_b)
- };
- var Qa = function (c, d) {
- return (b(c.bb_r, d.bb_r) - a(c.bb_l, d.bb_l)) * (b(c.bb_t, d.bb_t) - a(c.bb_b, d.bb_b))
- },
- Ra = function (a, b) {
- return Math.abs(a.bb_l + a.bb_r - b.bb_l - b.bb_r) + Math.abs(a.bb_b + a.bb_t - b.bb_b - b.bb_t)
- },
- ia = function (c, d, e) {
- if (null == c) return d;
- if (c.isLeaf) return e.makeNode(d, c);
- var f = c.B.bbArea() + Qa(c.A, d),
- g = c.A.bbArea() + Qa(c.B, d);
- return f === g && (f = Ra(c.A, d), g = Ra(c.B, d)), f > g ? c.setB(ia(c.B, d, e)) : c.setA(ia(c.A, d, e)), c.bb_l = a(c.bb_l, d.bb_l), c.bb_b = a(c.bb_b, d.bb_b), c.bb_r =
- b(c.bb_r, d.bb_r), c.bb_t = b(c.bb_t, d.bb_t), c
- };
- W.prototype.intersectsBB = X.prototype.intersectsBB = function (a) {
- return this.bb_l <= a.r && a.l <= this.bb_r && this.bb_b <= a.t && a.b <= this.bb_t
- };
- var Ba = function (a, b, c) {
- a.intersectsBB(b) && (a.isLeaf ? c(a.obj) : (Ba(a.A, b, c), Ba(a.B, b, c)))
- },
- Sa = function (c, d, e) {
- var f = 1 / (e.x - d.x),
- g = c.bb_l == d.x ? -1 / 0 : (c.bb_l - d.x) * f,
- h = c.bb_r == d.x ? 1 / 0 : (c.bb_r - d.x) * f,
- f = a(g, h),
- g = b(g, h),
- h = 1 / (e.y - d.y);
- e = c.bb_b == d.y ? -1 / 0 : (c.bb_b - d.y) * h;
- d = c.bb_t == d.y ? 1 / 0 : (c.bb_t - d.y) * h;
- c = a(e, d);
- d = b(e, d);
- return g >= c && d >=
- f && (f = b(f, c), 0 <= a(g, d) && 1 >= f) ? b(f, 0) : 1 / 0
- },
- ja = function (b, c, d, e, f) {
- if (b.isLeaf) return f(b.obj);
- var g = Sa(b.A, c, d),
- h = Sa(b.B, c, d);
- return h > g ? (e > g && (e = a(e, ja(b.A, c, d, e, f))), e > h && (e = a(e, ja(b.B, c, d, e, f)))) : (e > h && (e = a(e, ja(b.B, c, d, e, f))), e > g && (e = a(e, ja(b.A, c, d, e, f)))), e
- };
- I.prototype.subtreeRecycle = function (a) {
- a.isLeaf && (this.subtreeRecycle(a.A), this.subtreeRecycle(a.B), a.recycle(this))
- };
- var Ta = function (a, b, c) {
- if (b == a) return null;
- var d = b.parent;
- return d == a ? (b = a.otherChild(b), b.parent = a.parent, a.recycle(c),
- b) : (d.parent.replaceChild(d, d.otherChild(b), c), a)
- },
- Ua = function (a, b) {
- return a.bb_l <= b.bb_r && b.bb_l <= a.bb_r && a.bb_b <= b.bb_t && b.bb_b <= a.bb_t
- };
- X.prototype.markLeafQuery = function (a, b, c, d) {
- Ua(a, this) && (b ? Pa(a, this, c) : (this.stamp < a.stamp && Pa(this, a, c), d && d(a.obj, this.obj)))
- };
- W.prototype.markLeafQuery = function (a, b, c, d) {
- Ua(a, this) && (this.A.markLeafQuery(a, b, c, d), this.B.markLeafQuery(a, b, c, d))
- };
- X.prototype.markSubtree = function (a, b, c) {
- if (this.stamp == a.getStamp())
- for (b && b.markLeafQuery(this, !1, a, c), b = this; b.parent; b =
- b.parent) b == b.parent.A ? b.parent.B.markLeafQuery(this, !0, a, c) : b.parent.A.markLeafQuery(this, !1, a, c);
- else
- for (a = this.pairs; a;) this === a.leafB ? (c && c(a.leafA.obj, this.obj), a = a.nextB) : a = a.nextA
- };
- W.prototype.markSubtree = function (a, b, c) {
- this.A.markSubtree(a, b, c);
- this.B.markSubtree(a, b, c)
- };
- X.prototype.containsObj = function (a) {
- return this.bb_l <= a.bb_l && this.bb_r >= a.bb_r && this.bb_b <= a.bb_b && this.bb_t >= a.bb_t
- };
- X.prototype.update = function (a) {
- var b = a.root;
- return this.containsObj(this.obj) ? !1 : (a.getBB(this.obj, this),
- b = Ta(b, this, a), a.root = ia(b, this, a), this.clearPairs(a), this.stamp = a.getStamp(), !0)
- };
- X.prototype.addPairs = function (a) {
- var b = a.dynamicIndex;
- b ? (a = b.root) && a.markLeafQuery(this, !0, b, null) : this.markSubtree(a, a.staticIndex.root, null)
- };
- I.prototype.insert = function (a, b) {
- var c = new X(this, a);
- this.leaves[b] = c;
- this.root = ia(this.root, c, this);
- this.count++;
- c.stamp = this.getStamp();
- c.addPairs(this);
- this.incrementStamp()
- };
- I.prototype.remove = function (a, b) {
- var c = this.leaves[b];
- delete this.leaves[b];
- this.root = Ta(this.root,
- c, this);
- this.count--;
- c.clearPairs(this);
- c.recycle(this)
- };
- I.prototype.contains = function (a, b) {
- return null != this.leaves[b]
- };
- var lb = function () {};
- I.prototype.reindexQuery = function (a) {
- if (this.root) {
- var b, c = this.leaves;
- for (b in c) c[b].update(this);
- c = (b = this.staticIndex) && b.root;
- this.root.markSubtree(this, c, a);
- b && !c && this.collideStatic(this, b, a);
- this.incrementStamp()
- }
- };
- I.prototype.reindex = function () {
- this.reindexQuery(lb)
- };
- I.prototype.reindexObject = function (a, b) {
- var c = this.leaves[b];
- c && (c.update(this) && c.addPairs(this),
- this.incrementStamp())
- };
- I.prototype.pointQuery = function (a, b) {
- this.query(new $(a.x, a.y, a.x, a.y), b)
- };
- I.prototype.segmentQuery = function (a, b, c, d) {
- this.root && ja(this.root, a, b, c, d)
- };
- I.prototype.query = function (a, b) {
- this.root && Ba(this.root, a, b)
- };
- I.prototype.count = function () {
- return this.count
- };
- I.prototype.each = function (a) {
- for (var b in this.leaves) a(this.leaves[b].obj)
- };
- var Ca = function (c, d, e, f) {
- if (1 == f) return d[e];
- if (2 == f) return c.makeNode(d[e], d[e + 1]);
- for (var g = d[e], h = g.bb_l, k = g.bb_b, m = g.bb_r, n = g.bb_t, q = e +
- f, p = e + 1; q > p; p++) g = d[p], h = a(h, g.bb_l), k = a(k, g.bb_b), m = b(m, g.bb_r), n = b(n, g.bb_t);
- var g = m - h > n - k,
- r = Array(2 * f);
- if (g)
- for (p = e; q > p; p++) r[2 * p + 0] = d[p].bb_l, r[2 * p + 1] = d[p].bb_r;
- else
- for (p = e; q > p; p++) r[2 * p + 0] = d[p].bb_b, r[2 * p + 1] = d[p].bb_t;
- r.sort(function (a, b) {
- return a - b
- });
- var s = 0.5 * (r[f - 1] + r[f]),
- p = h,
- r = k,
- t = m,
- w = n;
- g ? t = h = s : w = k = s;
- for (var s = q, u = e; s > u;) g = d[u], (b(g.bb_r, m) - a(g.bb_l, h)) * (b(g.bb_t, n) - a(g.bb_b, k)) < (b(g.bb_r, t) - a(g.bb_l, p)) * (b(g.bb_t, w) - a(g.bb_b, r)) ? (s--, d[u] = d[s], d[s] = g) : u++;
- if (s == f) {
- g = null;
- for (p = e; q > p; p++) g =
- ia(g, d[p], c);
- return g
- }
- return NodeNew(c, Ca(c, d, e, s - e), Ca(c, d, s, q - s))
- };
- I.prototype.optimize = function () {
- var a = Array(this.count),
- b = 0,
- c;
- for (c in this.leaves) a[b++] = this.nodes[c];
- tree.subtreeRecycle(root);
- this.root = Ca(tree, a, a.length)
- };
- var Da = function (a, b) {
- !a.isLeaf && 10 >= b && (Da(a.A, b + 1), Da(a.B, b + 1));
- for (var c = "", d = 0; b > d; d++) c += " ";
- console.log(c + a.bb_b + " " + a.bb_t)
- };
- I.prototype.log = function () {
- this.root && Da(this.root, 0)
- };
- var ea = c.CollisionHandler = function () {
- this.a = this.b = 0
- };
- ea.prototype.begin = function () {
- return !0
- };
- ea.prototype.preSolve = function () {
- return !0
- };
- ea.prototype.postSolve = function () {};
- ea.prototype.separate = function () {};
- var L = function (a, b) {
- this.u = this.e = 0;
- this.surface_vr = w;
- this.a = a;
- this.body_a = a.body;
- this.b = b;
- this.body_b = b.body;
- this.contacts = this.thread_b_next = this.thread_b_prev = this.thread_a_next = this.thread_a_prev = null;
- this.stamp = 0;
- this.handler = null;
- this.swappedColl = !1;
- this.state = "first coll"
- };
- L.prototype.getShapes = function () {
- return this.swappedColl ? [this.b, this.a] : [this.a, this.b]
- };
- L.prototype.totalImpulse =
- function () {
- for (var a = this.contacts, b = new q(0, 0), c = 0, d = a.length; d > c; c++) {
- var e = a[c];
- b.add(z(e.n, e.jnAcc))
- }
- return this.swappedColl ? b : b.neg()
- };
- L.prototype.totalImpulseWithFriction = function () {
- for (var a = this.contacts, b = new q(0, 0), c = 0, d = a.length; d > c; c++) {
- var e = a[c];
- b.add((new q(e.jnAcc, e.jtAcc))
- .rotate(e.n))
- }
- return this.swappedColl ? b : b.neg()
- };
- L.prototype.totalKE = function () {
- for (var a = (1 - this.e) / (1 + this.e), b = 0, c = this.contacts, d = 0, e = c.length; e > d; d++) var f = c[d],
- g = f.jnAcc,
- h = f.jtAcc,
- b = b + (a * g * g / f.nMass + h * h / f.tMass);
- return b
- };
- L.prototype.ignore = function () {
- this.state = "ignore"
- };
- L.prototype.getA = function () {
- return this.swappedColl ? this.b : this.a
- };
- L.prototype.getB = function () {
- return this.swappedColl ? this.a : this.b
- };
- L.prototype.isFirstContact = function () {
- return "first coll" === this.state
- };
- var Va = function (a, b, c) {
- this.point = a;
- this.normal = b;
- this.dist = c
- };
- L.prototype.getContactPointSet = function () {
- var a, b = Array(this.contacts.length);
- for (a = 0; b.length > a; a++) b[a] = new Va(this.contacts[a].p, this.contacts[a].n, this.contacts[a].dist);
- return b
- };
- L.prototype.getNormal = function (a) {
- a = this.contacts[a].n;
- return this.swappedColl ? C(a) : a
- };
- L.prototype.getPoint = function (a) {
- return this.contacts[a].p
- };
- L.prototype.getDepth = function (a) {
- return this.contacts[a].dist
- };
- var Wa = function (a, b, c, d) {
- c ? c.body_a === b ? c.thread_a_next = d : c.thread_b_next = d : b.arbiterList = d;
- d && (d.body_a === b ? d.thread_a_prev = c : d.thread_b_prev = c)
- };
- L.prototype.unthread = function () {
- Wa(this, this.body_a, this.thread_a_prev, this.thread_a_next);
- Wa(this, this.body_b, this.thread_b_prev, this.thread_b_next);
- this.thread_b_prev = this.thread_b_next = this.thread_a_prev = this.thread_a_next = null
- };
- L.prototype.update = function (a, b, c, d) {
- if (this.contacts)
- for (var e = 0; this.contacts.length > e; e++)
- for (var f = this.contacts[e], g = 0; a.length > g; g++) {
- var h = a[g];
- h.hash === f.hash && (h.jnAcc = f.jnAcc, h.jtAcc = f.jtAcc)
- }
- this.contacts = a;
- this.handler = b;
- this.swappedColl = c.collision_type !== b.a;
- this.e = c.e * d.e;
- this.u = c.u * d.u;
- this.surface_vr = y(c.surface_v, d.surface_v);
- this.a = c;
- this.body_a = c.body;
- this.b = d;
- this.body_b = d.body;
- "cached" == this.state &&
- (this.state = "first coll")
- };
- L.prototype.preStep = function (b, c, d) {
- for (var e = this.body_a, f = this.body_b, g = 0; this.contacts.length > g; g++) {
- var h = this.contacts[g];
- h.r1 = y(h.p, e.p);
- h.r2 = y(h.p, f.p);
- h.nMass = 1 / ka(e, f, h.r1, h.r2, h.n);
- h.tMass = 1 / ka(e, f, h.r1, h.r2, J(h.n));
- h.bias = -d * a(0, h.dist + c) / b;
- h.jBias = 0;
- h.bounce = Ea(e, f, h.r1, h.r2, h.n) * this.e
- }
- };
- L.prototype.applyCachedImpulse = function (a) {
- if (!this.isFirstContact())
- for (var b = this.body_a, c = this.body_b, d = 0; this.contacts.length > d; d++) {
- var e = this.contacts[d],
- f = e.n.x,
- g = e.n.y;
- U(b, c, e.r1, e.r2, (f * e.jnAcc - g * e.jtAcc) * a, (f * e.jtAcc + g * e.jnAcc) * a)
- }
- };
- var mb = 0,
- nb = 0;
- L.prototype.applyImpulse = function () {
- mb++;
- for (var a = this.body_a, c = this.body_b, d = this.surface_vr, e = this.u, f = 0; this.contacts.length > f; f++) {
- nb++;
- var g = this.contacts[f],
- h = g.nMass,
- k = g.n,
- m = g.r1,
- n = g.r2,
- q = c.vx - n.y * c.w - (a.vx - m.y * a.w),
- p = c.vy + n.x * c.w - (a.vy + m.x * a.w),
- r = q * k.x + p * k.y,
- t = (q + d.x) * -k.y + (p + d.y) * k.x,
- p = g.jBias;
- g.jBias = b(p + (g.bias - (k.x * (c.v_biasx - n.y * c.w_bias - a.v_biasx + m.y * a.w_bias) + k.y * (n.x * c.w_bias + c.v_biasy - m.x * a.w_bias - a.v_biasy))) *
- h, 0);
- q = g.jnAcc;
- g.jnAcc = b(q + -(g.bounce + r) * h, 0);
- r = e * g.jnAcc;
- h = g.jtAcc;
- g.jtAcc = s(h + -t * g.tMass, -r, r);
- r = k.x * (g.jBias - p);
- p = k.y * (g.jBias - p);
- Xa(a, -r, -p, m);
- Xa(c, r, p, n);
- q = g.jnAcc - q;
- g = g.jtAcc - h;
- U(a, c, m, n, k.x * q - k.y * g, k.x * g + k.y * q)
- }
- };
- L.prototype.callSeparate = function (a) {
- a.lookupHandler(this.a.collision_type, this.b.collision_type)
- .separate(this, a)
- };
- L.prototype.next = function (a) {
- return this.body_a == a ? this.thread_a_next : this.thread_b_next
- };
- var ob = 0,
- aa = function (a, b, c, d) {
- this.p = a;
- this.n = b;
- this.dist = c;
- this.r1 = this.r2 =
- w;
- this.jnAcc = this.jtAcc = this.jBias = this.nMass = this.tMass = this.bounce = this.bias = 0;
- this.hash = d;
- ob++
- },
- V = [],
- ca = function (a, b, c, d) {
- d = c + d;
- b = y(b, a);
- var e = N(b);
- if (!(e >= d * d)) return e = Math.sqrt(e), new aa(A(a, z(b, 0.5 + (c - 0.5 * d) / (e ? e : 1 / 0))), e ? z(b, 1 / e) : new q(1, 0), e - d, 0)
- },
- Fa = 0,
- Ya = function (a, b) {
- var c = 0,
- d = a.valueOnAxis(b[0].n, b[0].d);
- if (0 < d) return -1;
- for (var e = 1; b.length > e; e++) {
- var f = a.valueOnAxis(b[e].n, b[e].d);
- if (0 < f) return -1;
- f > d && (d = f, c = e)
- }
- return Fa = d, c
- },
- Za = function (a, b, c, d) {
- for (var e = [], f = a.tVerts, g = 0; f.length >
- g; g += 2) {
- var k = f[g],
- m = f[g + 1];
- b.containsVert(k, m) && e.push(new aa(new q(k, m), c, d, h(a.hashid, g >> 1)))
- }
- f = b.tVerts;
- for (g = 0; f.length > g; g += 2) k = f[g], m = f[g + 1], a.containsVert(k, m) && e.push(new aa(new q(k, m), c, d, h(b.hashid, g >> 1)));
- if (!e.length) {
- e = [];
- f = a.tVerts;
- for (g = 0; f.length > g; g += 2) k = f[g], m = f[g + 1], b.containsVertPartial(k, m, C(c)) && e.push(new aa(new q(k, m), c, d, h(a.hashid, g)));
- f = b.tVerts;
- for (g = 0; f.length > g; g += 2) k = f[g], m = f[g + 1], a.containsVertPartial(k, m, c) && e.push(new aa(new q(k, m), c, d, h(b.hashid, g)))
- }
- return a = e
- },
- $a = function (b, c, d) {
- var e = u(c, b.ta) - b.r;
- b = u(c, b.tb) - b.r;
- return a(e, b) - d
- },
- ab = function (a, b, c, d, e) {
- for (var f = F(b.tn, b.ta), g = F(b.tn, b.tb), k = z(b.tn, e), m = c.tVerts, n = 0; m.length > n; n += 2) {
- var p = m[n],
- r = m[n + 1];
- if (p * k.x + r * k.y < u(b.tn, b.ta) * e + b.r) {
- var s = b.tn.x * r - b.tn.y * p;
- f >= s && s >= g && a.push(new aa(new q(p, r), k, d, h(c.hashid, n)))
- }
- }
- };
- fa.prototype.collisionCode = 0;
- ba.prototype.collisionCode = 1;
- R.prototype.collisionCode = 2;
- fa.prototype.collisionTable = [
- function (a, b) {
- var c = ca(a.tc, b.tc, a.r, b.r);
- return c ? [c] : V
- },
- function (a, b) {
- var c =
- b.ta,
- d = a.tc,
- e = y(b.tb, c),
- f = t(u(e, y(d, c)) / N(e)),
- c = A(c, z(e, f));
- return (d = ca(d, c, a.r, b.r)) ? (c = d.n, 0 === f && 0 > u(c, b.a_tangent) || 1 === f && 0 > u(c, b.b_tangent) ? V : [d]) : V
- },
- function (a, b) {
- for (var c = b.tPlanes, d = 0, e = u(c[0].n, a.tc) - c[0].d - a.r, f = 0; c.length > f; f++) {
- var g = u(c[f].n, a.tc) - c[f].d - a.r;
- if (0 < g) return V;
- g > e && (e = g, d = f)
- }
- var c = c[d].n,
- h = b.tVerts,
- k = h.length,
- m = d << 1,
- d = h[m],
- f = h[m + 1],
- g = h[(m + 2) % k],
- h = h[(m + 3) % k],
- k = c.x * f - c.y * d,
- m = c.x * h - c.y * g,
- n = F(c, a.tc);
- if (m > n) {
- var p = ca(a.tc, new q(g, h), a.r, 0, p);
- return p ? [p] : V
- }
- return k > n ? [new aa(y(a.tc,
- z(c, a.r + e / 2)), C(c), e, 0)] : (p = ca(a.tc, new q(d, f), a.r, 0, p)) ? [p] : V
- }
- ];
- ba.prototype.collisionTable = [null,
- function () {
- return V
- },
- function (a, b) {
- var c = [],
- d = b.tPlanes,
- e = d.length,
- f = u(a.tn, a.ta),
- g = b.valueOnAxis(a.tn, f) - a.r,
- f = b.valueOnAxis(C(a.tn), -f) - a.r;
- if (0 < f || 0 < g) return V;
- var k = 0,
- m = $a(a, d[0].n, d[0].d);
- if (0 < m) return V;
- for (var n = 0; e > n; n++) {
- var p = $a(a, d[n].n, d[n].d);
- if (0 < p) return V;
- p > m && (m = p, k = n)
- }
- d = C(d[k].n);
- n = A(a.ta, z(d, a.r));
- p = A(a.tb, z(d, a.r));
- if (b.containsVert(n.x, n.y) && c.push(new aa(n, d, m, h(a.hashid, 0))), b.containsVert(p.x,
- p.y) && c.push(new aa(p, d, m, h(a.hashid, 1))), (g >= m || f >= m) && (g > f ? ab(c, a, b, g, 1) : ab(c, a, b, f, -1)), 0 === c.length) {
- f = 2 * k;
- k = b.tVerts;
- m = new q(k[f], k[f + 1]);
- if ((g = ca(a.ta, m, a.r, 0, c)) || (g = ca(a.tb, m, a.r, 0, c))) return [g];
- e *= 2;
- e = new q(k[(f + 2) % e], k[(f + 3) % e]);
- if ((g = ca(a.ta, e, a.r, 0, c)) || (g = ca(a.tb, e, a.r, 0, c))) return [g]
- }
- return c
- }
- ];
- R.prototype.collisionTable = [null, null,
- function (a, b) {
- var c = Ya(b, a.tPlanes);
- if (-1 == c) return V;
- var d = Fa,
- e = Ya(a, b.tPlanes);
- if (-1 == e) return V;
- var f = Fa;
- return d > f ? Za(a, b, a.tPlanes[c].n, d) : Za(a, b, C(b.tPlanes[e].n),
- f)
- }
- ];
- var Ga = c.collideShapes = function (a, b) {
- return g(a.collisionCode <= b.collisionCode, "Collided shapes must be sorted by type"), a.collisionTable[b.collisionCode](a, b)
- },
- bb = new ea,
- B = c.Space = function () {
- this.curr_dt = this.stamp = 0;
- this.bodies = [];
- this.rousedBodies = [];
- this.sleepingComponents = [];
- this.staticShapes = new I(null);
- this.activeShapes = new I(this.staticShapes);
- this.arbiters = [];
- this.contactBuffersHead = null;
- this.cachedArbiters = {};
- this.constraints = [];
- this.locked = 0;
- this.collisionHandlers = {};
- this.defaultHandler =
- bb;
- this.postStepCallbacks = [];
- this.iterations = 10;
- this.gravity = w;
- this.damping = 1;
- this.idleSpeedThreshold = 0;
- this.sleepTimeThreshold = 1 / 0;
- this.collisionSlop = 0.1;
- this.collisionBias = Math.pow(0.9, 60);
- this.collisionPersistence = 3;
- this.enableContactGraph = !1;
- this.staticBody = new D(1 / 0, 1 / 0);
- this.staticBody.nodeIdleTime = 1 / 0;
- this.collideShapes = this.makeCollideShapes()
- };
- B.prototype.getCurrentTimeStep = function () {
- return this.curr_dt
- };
- B.prototype.setIterations = function (a) {
- this.iterations = a
- };
- B.prototype.isLocked = function () {
- return this.locked
- };
- var Y = function (a) {
- g(!a.locked, "This addition/removal cannot be done safely during a call to cpSpaceStep() or during a query. Put these calls into a post-step callback.")
- };
- B.prototype.addCollisionHandler = function (a, b, c, d, e, f) {
- Y(this);
- this.removeCollisionHandler(a, b);
- var g = new ea;
- g.a = a;
- g.b = b;
- c && (g.begin = c);
- d && (g.preSolve = d);
- e && (g.postSolve = e);
- f && (g.separate = f);
- this.collisionHandlers[h(a, b)] = g
- };
- B.prototype.removeCollisionHandler = function (a, b) {
- Y(this);
- delete this.collisionHandlers[h(a, b)]
- };
- B.prototype.setDefaultCollisionHandler =
- function (a, b, c, d) {
- Y(this);
- var e = new ea;
- a && (e.begin = a);
- b && (e.preSolve = b);
- c && (e.postSolve = c);
- d && (e.separate = d);
- this.defaultHandler = e
- };
- B.prototype.lookupHandler = function (a, b) {
- return this.collisionHandlers[h(a, b)] || this.defaultHandler
- };
- B.prototype.addShape = function (a) {
- var b = a.body;
- return b.isStatic() ? this.addStaticShape(a) : (g(!a.space, "This shape is already added to a space and cannot be added to another."), Y(this), b.activate(), b.addShape(a), a.update(b.p, b.rot), this.activeShapes.insert(a, a.hashid), a.space =
- this, a)
- };
- B.prototype.addStaticShape = function (a) {
- g(!a.space, "This shape is already added to a space and cannot be added to another.");
- Y(this);
- var b = a.body;
- return b.addShape(a), a.update(b.p, b.rot), this.staticShapes.insert(a, a.hashid), a.space = this, a
- };
- B.prototype.addBody = function (a) {
- return g(!a.isStatic(), "Static bodies cannot be added to a space as they are not meant to be simulated."), g(!a.space, "This body is already added to a space and cannot be added to another."), Y(this), this.bodies.push(a), a.space =
- this, a
- };
- B.prototype.addConstraint = function (a) {
- g(!a.space, "This shape is already added to a space and cannot be added to another.");
- Y(this);
- var b = a.a,
- c = a.b;
- return b.activate(), c.activate(), this.constraints.push(a), a.next_a = b.constraintList, b.constraintList = a, a.next_b = c.constraintList, c.constraintList = a, a.space = this, a
- };
- B.prototype.filterArbiters = function (a, b) {
- for (var c in this.cachedArbiters) {
- var d = this.cachedArbiters[c];
- (a !== d.body_a || b !== d.a && null !== b) && (a !== d.body_b || b !== d.b && null !== b) || (b && "cached" !==
- d.state && d.callSeparate(this), d.unthread(), k(this.arbiters, d), delete this.cachedArbiters[c])
- }
- };
- B.prototype.removeShape = function (a) {
- var b = a.body;
- b.isStatic() ? this.removeStaticShape(a) : (g(this.containsShape(a), "Cannot remove a shape that was not added to the space. (Removed twice maybe?)"), Y(this), b.activate(), b.removeShape(a), this.filterArbiters(b, a), this.activeShapes.remove(a, a.hashid), a.space = null)
- };
- B.prototype.removeStaticShape = function (a) {
- g(this.containsShape(a), "Cannot remove a static or sleeping shape that was not added to the space. (Removed twice maybe?)");
- Y(this);
- var b = a.body;
- b.isStatic() && b.activateStatic(a);
- b.removeShape(a);
- this.filterArbiters(b, a);
- this.staticShapes.remove(a, a.hashid);
- a.space = null
- };
- B.prototype.removeBody = function (a) {
- g(this.containsBody(a), "Cannot remove a body that was not added to the space. (Removed twice maybe?)");
- Y(this);
- a.activate();
- k(this.bodies, a);
- a.space = null
- };
- B.prototype.removeConstraint = function (a) {
- g(this.containsConstraint(a), "Cannot remove a constraint that was not added to the space. (Removed twice maybe?)");
- Y(this);
- a.a.activate();
- a.b.activate();
- k(this.constraints, a);
- a.a.removeConstraint(a);
- a.b.removeConstraint(a);
- a.space = null
- };
- B.prototype.containsShape = function (a) {
- return a.space === this
- };
- B.prototype.containsBody = function (a) {
- return a.space == this
- };
- B.prototype.containsConstraint = function (a) {
- return a.space == this
- };
- B.prototype.uncacheArbiter = function (a) {
- delete this.cachedArbiters[h(a.a.hashid, a.b.hashid)];
- k(this.arbiters, a)
- };
- B.prototype.eachBody = function (a) {
- this.lock();
- for (var b = this.bodies, c = 0; b.length > c; c++) a(b[c]);
- b = this.sleepingComponents;
- for (c = 0; b.length > c; c++)
- for (var d = b[c]; d;) {
- var e = d.nodeNext;
- a(d);
- d = e
- }
- this.unlock(!0)
- };
- B.prototype.eachShape = function (a) {
- this.lock();
- this.activeShapes.each(a);
- this.staticShapes.each(a);
- this.unlock(!0)
- };
- B.prototype.eachConstraint = function (a) {
- this.lock();
- for (var b = this.constraints, c = 0; b.length > c; c++) a(b[c]);
- this.unlock(!0)
- };
- B.prototype.reindexStatic = function () {
- g(!this.locked, "You cannot manually reindex objects while the space is locked. Wait until the current query or step is complete.");
- this.staticShapes.each(function (a) {
- var b = a.body;
- a.update(b.p, b.rot)
- });
- this.staticShapes.reindex()
- };
- B.prototype.reindexShape = function (a) {
- g(!this.locked, "You cannot manually reindex objects while the space is locked. Wait until the current query or step is complete.");
- var b = a.body;
- a.update(b.p, b.rot);
- this.activeShapes.reindexObject(a, a.hashid);
- this.staticShapes.reindexObject(a, a.hashid)
- };
- B.prototype.reindexShapesForBody = function (a) {
- for (a = a.shapeList; a; a = a.next) this.reindexShape(a)
- };
- B.prototype.useSpatialHash =
- function (a, b) {
- throw Error("Spatial Hash not implemented.");
- };
- B.prototype.activateBody = function (a) {
- if (g(!a.isRogue(), "Internal error: Attempting to activate a rogue body."), this.locked) - 1 === this.rousedBodies.indexOf(a) && this.rousedBodies.push(a);
- else {
- this.bodies.push(a);
- for (var b = 0; a.shapeList.length > b; b++) {
- var c = a.shapeList[b];
- this.staticShapes.remove(c, c.hashid);
- this.activeShapes.insert(c, c.hashid)
- }
- for (b = a.arbiterList; b; b = b.next(a))
- if (c = b.body_a, a === c || c.isStatic()) {
- var c = b.a,
- d = b.b;
- this.cachedArbiters[h(c.hashid,
- d.hashid)] = b;
- b.stamp = this.stamp;
- b.handler = this.lookupHandler(c.collision_type, d.collision_type);
- this.arbiters.push(b)
- }
- for (b = a.constraintList; b; b = b.nodeNext) c = b.a, (a === c || c.isStatic()) && this.constraints.push(b)
- }
- };
- B.prototype.deactivateBody = function (a) {
- g(!a.isRogue(), "Internal error: Attempting to deactivate a rogue body.");
- k(this.bodies, a);
- for (var b = 0; a.shapeList.length > b; b++) {
- var c = a.shapeList[b];
- this.activeShapes.remove(c, c.hashid);
- this.staticShapes.insert(c, c.hashid)
- }
- for (c = a.arbiterList; c; c = c.next(a)) b =
- c.body_a, (a === b || b.isStatic()) && this.uncacheArbiter(c);
- for (c = a.constraintList; c; c = c.nodeNext) b = c.a, (a === b || b.isStatic()) && k(this.constraints, c)
- };
- D.prototype.activate = function () {
- if (!this.isRogue()) {
- this.nodeIdleTime = 0;
- var a = this ? this.nodeRoot : null;
- if (a && a.isSleeping(a)) {
- g(!a.isRogue(), "Internal Error: componentActivate() called on a rogue body.");
- for (var b = a.space, c = a; c;) {
- var d = c.nodeNext;
- c.nodeIdleTime = 0;
- c.nodeRoot = null;
- c.nodeNext = null;
- b.activateBody(c);
- c = d
- }
- k(b.sleepingComponents, a)
- }
- }
- };
- D.prototype.activateStatic =
- function (a) {
- g(this.isStatic(), "Body.activateStatic() called on a non-static body.");
- for (var b = this.arbiterList; b; b = b.next(this)) a && a != b.a && a != b.b || (b.body_a == this ? b.body_b : b.body_a)
- .activate()
- };
- D.prototype.pushArbiter = function (a) {
- f(null === (a.body_a === this ? a.thread_a_next : a.thread_b_next), "Internal Error: Dangling contact graph pointers detected. (A)");
- f(null === (a.body_a === this ? a.thread_a_prev : a.thread_b_prev), "Internal Error: Dangling contact graph pointers detected. (B)");
- var b = this.arbiterList;
- f(null === b || null === (b.body_a === this ? b.thread_a_prev : b.thread_b_prev), "Internal Error: Dangling contact graph pointers detected. (C)");
- a.body_a === this ? a.thread_a_next = b : a.thread_b_next = b;
- b && (b.body_a === this ? b.thread_a_prev = a : b.thread_b_prev = a);
- this.arbiterList = a
- };
- var Ha = function (a, b) {
- if (!b.isRogue()) {
- var c = b ? b.nodeRoot : null;
- if (null == c) {
- b.nodeRoot = a;
- b !== a && (b.nodeNext = a.nodeNext, a.nodeNext = b);
- for (c = b.arbiterList; c; c = c.next(b)) Ha(a, b == c.body_a ? c.body_b : c.body_a);
- for (c = b.constraintList; c; c = c.next(b)) Ha(a,
- b == c.a ? c.b : c.a)
- } else f(c === a, "Internal Error: Inconsistency detected in the contact graph.")
- }
- };
- B.prototype.processComponents = function (a) {
- for (var b = 1 / 0 !== this.sleepTimeThreshold, c = this.bodies, d = 0; c.length > d; d++) {
- var e = c[d];
- f(null === e.nodeNext, "Internal Error: Dangling next pointer detected in contact graph.");
- f(null === e.nodeRoot, "Internal Error: Dangling root pointer detected in contact graph.")
- }
- if (b)
- for (var g = (d = this.idleSpeedThreshold) ? d * d : N(this.gravity) * a * a, d = 0; c.length > d; d++) {
- var e = c[d],
- h = g ? e.m *
- g : 0;
- e.nodeIdleTime = e.kineticEnergy() > h ? 0 : e.nodeIdleTime + a
- }
- g = this.arbiters;
- d = 0;
- for (h = g.length; h > d; d++) {
- var k = g[d],
- e = k.body_a;
- a = k.body_b;
- b && ((a.isRogue() && !a.isStatic() || e.isSleeping()) && e.activate(), (e.isRogue() && !e.isStatic() || a.isSleeping()) && a.activate());
- e.pushArbiter(k);
- a.pushArbiter(k)
- }
- if (b) {
- b = this.constraints;
- for (d = 0; b.length > d; d++) a = b[d], e = a.a, a = a.b, a.isRogue() && !a.isStatic() && e.activate(), e.isRogue() && !e.isStatic() && a.activate();
- for (d = 0; c.length > d;) {
- e = c[d];
- if (!(b = null !== (e ? e.nodeRoot : null))) a: {
- for (Ha(e,
- e), b = e; b; b = b.nodeNext)
- if (this.sleepTimeThreshold > b.nodeIdleTime) {
- b = !0;
- break a
- }
- b = !1
- }
- if (b) d++, e.nodeRoot = null, e.nodeNext = null;
- else
- for (this.sleepingComponents.push(e), b = e; b; b = b.nodeNext) this.deactivateBody(b)
- }
- }
- };
- D.prototype.sleep = function () {
- this.sleepWithGroup(null)
- };
- D.prototype.sleepWithGroup = function (a) {
- g(!this.isStatic() && !this.isRogue(), "Rogue and static bodies cannot be put to sleep.");
- var b = this.space;
- if (g(b, "Cannot put a rogue body to sleep."), g(!b.locked, "Bodies cannot be put to sleep during a query or a call to cpSpaceStep(). Put these calls into a post-step callback."),
- g(null === a || a.isSleeping(), "Cannot use a non-sleeping body as a group identifier."), this.isSleeping()) return g((this ? this.nodeRoot : null) === (a ? a.nodeRoot : null), "The body is already sleeping and it's group cannot be reassigned."), void 0;
- for (var c = 0; this.shapeList.length > c; c++) this.shapeList[c].update(this.p, this.rot);
- (b.deactivateBody(this), a) ? (this.nodeRoot = a = a ? a.nodeRoot : null, this.nodeNext = a.nodeNext, this.nodeIdleTime = 0, a.nodeNext = this) : (this.nodeRoot = this, this.nodeNext = null, this.nodeIdleTime = 0, b.sleepingComponents.push(this));
- k(b.bodies, this)
- };
- B.prototype.activateShapesTouchingShape = function (a) {
- 1 / 0 !== this.sleepTimeThreshold && this.shapeQuery(a, function (a) {
- a.body.activate()
- })
- };
- B.prototype.pointQuery = function (a, b, c, d) {
- var e = function (e) {
- (!e.group || c !== e.group) && b & e.layers && e.pointQuery(a) && d(e)
- },
- f = new $(a.x, a.y, a.x, a.y);
- this.lock();
- this.activeShapes.query(f, e);
- this.staticShapes.query(f, e);
- this.unlock(!0)
- };
- B.prototype.pointQueryFirst = function (a, b, c) {
- var d = null;
- return this.pointQuery(a, b, c, function (a) {
- a.sensor || (d = a)
- }), d
- };
- B.prototype.nearestPointQuery =
- function (a, b, c, d, e) {
- var f = function (f) {
- if ((!f.group || d !== f.group) && c & f.layers) {
- var g = f.nearestPointQuery(a);
- b > g.d && e(f, g.d, g.p)
- }
- },
- g = new $(a.x - b, a.y - b, a.x + b, a.y + b);
- this.lock();
- this.activeShapes.query(g, f);
- this.staticShapes.query(g, f);
- this.unlock(!0)
- };
- B.prototype.nearestPointQueryNearest = function (a, b, c, d) {
- var e, f = function (f) {
- f.group && d === f.group || !(c & f.layers) || f.sensor || (f = f.nearestPointQuery(a), b > f.d && (!e || f.d < e.d) && (e = f))
- },
- g = new $(a.x - b, a.y - b, a.x + b, a.y + b);
- return this.activeShapes.query(g, f), this.staticShapes.query(g,
- f), e
- };
- B.prototype.segmentQuery = function (a, b, c, d, e) {
- var f = function (f) {
- var g;
- return (!f.group || d !== f.group) && c & f.layers && (g = f.segmentQuery(a, b)) && e(f, g.t, g.n), 1
- };
- this.lock();
- this.staticShapes.segmentQuery(a, b, 1, f);
- this.activeShapes.segmentQuery(a, b, 1, f);
- this.unlock(!0)
- };
- B.prototype.segmentQueryFirst = function (a, b, c, d) {
- var e = null,
- f = function (f) {
- var g;
- return (!f.group || d !== f.group) && c & f.layers && !f.sensor && (g = f.segmentQuery(a, b)) && (null === e || g.t < e.t) && (e = g), e ? e.t : 1
- };
- return this.staticShapes.segmentQuery(a,
- b, 1, f), this.activeShapes.segmentQuery(a, b, e ? e.t : 1, f), e
- };
- B.prototype.bbQuery = function (a, b, c, d) {
- var e = function (e) {
- (!e.group || c !== e.group) && b & e.layers && e.bb_r >= a.l && a.r >= e.bb_l && e.bb_t >= a.b && a.t >= e.bb_b && d(e)
- };
- this.lock();
- this.activeShapes.query(a, e);
- this.staticShapes.query(a, e);
- this.unlock(!0)
- };
- B.prototype.shapeQuery = function (a, b) {
- var c = a.body;
- c && a.update(c.p, c.rot);
- var c = new $(a.bb_l, a.bb_b, a.bb_r, a.bb_t),
- d = !1,
- e = function (c) {
- if ((!a.group || a.group !== c.group) && a.layers & c.layers && a !== c) {
- var e;
- if (a.collisionCode <=
- c.collisionCode) e = Ga(a, c);
- else {
- e = Ga(c, a);
- for (var f = 0; e.length > f; f++) e[f].n = C(e[f].n)
- } if (e.length && (d = !(a.sensor || c.sensor), b)) {
- for (var g = Array(e.length), f = 0; e.length > f; f++) g[f] = new Va(e[f].p, e[f].n, e[f].dist);
- b(c, g)
- }
- }
- };
- return this.lock(), this.activeShapes.query(c, e), this.staticShapes.query(c, e), this.unlock(!0), d
- };
- B.prototype.addPostStepCallback = function (a) {
- f(this.locked, "Adding a post-step callback when the space is not locked is unnecessary. Post-step callbacks will not called until the end of the next call to cpSpaceStep() or the next query.");
- this.postStepCallbacks.push(a)
- };
- B.prototype.runPostStepCallbacks = function () {
- for (var a = 0; this.postStepCallbacks.length > a; a++) this.postStepCallbacks[a]();
- this.postStepCallbacks = []
- };
- B.prototype.lock = function () {
- this.locked++
- };
- B.prototype.unlock = function (a) {
- if (this.locked--, g(0 <= this.locked, "Internal Error: Space lock underflow."), 0 === this.locked && a) {
- a = this.rousedBodies;
- for (var b = 0; a.length > b; b++) this.activateBody(a[b]);
- a.length = 0;
- this.runPostStepCallbacks()
- }
- };
- B.prototype.makeCollideShapes = function () {
- var a =
- this;
- return function (b, c) {
- if (b.bb_l <= c.bb_r && c.bb_l <= b.bb_r && b.bb_b <= c.bb_t && c.bb_b <= b.bb_t && b.body !== c.body && (!b.group || b.group !== c.group) && b.layers & c.layers) {
- var d = a.lookupHandler(b.collision_type, c.collision_type),
- e = b.sensor || c.sensor;
- if (!e || d !== bb) {
- if (b.collisionCode > c.collisionCode) {
- var f = b;
- b = c;
- c = f
- }
- f = Ga(b, c);
- if (0 !== f.length) {
- var g = h(b.hashid, c.hashid),
- k = a.cachedArbiters[g];
- k || (k = a.cachedArbiters[g] = new L(b, c));
- k.update(f, d, b, c);
- "first coll" != k.state || d.begin(k, a) || k.ignore();
- "ignore" !== k.state &&
- d.preSolve(k, a) && !e ? a.arbiters.push(k) : (k.contacts = null, "ignore" !== k.state && (k.state = "normal"));
- k.stamp = a.stamp
- }
- }
- }
- }
- };
- B.prototype.arbiterSetFilter = function (a) {
- var b = this.stamp - a.stamp,
- c = a.body_a,
- d = a.body_b;
- return (c.isStatic() || c.isSleeping()) && (d.isStatic() || d.isSleeping()) ? !0 : (1 <= b && "cached" != a.state && (a.callSeparate(this), a.state = "cached"), b >= this.collisionPersistence ? (a.contacts = null, !1) : !0)
- };
- var pb = function (a) {
- var b = a.body;
- a.update(b.p, b.rot)
- };
- B.prototype.step = function (a) {
- if (0 !== a) {
- g(0 === w.x &&
- 0 === w.y, "vzero is invalid");
- this.stamp++;
- var b = this.curr_dt;
- this.curr_dt = a;
- var c, d, e = this.bodies,
- f = this.constraints,
- h = this.arbiters;
- for (c = 0; h.length > c; c++) {
- var k = h[c];
- k.state = "normal";
- k.body_a.isSleeping() || k.body_b.isSleeping() || k.unthread()
- }
- h.length = 0;
- this.lock();
- for (c = 0; e.length > c; c++) e[c].position_func(a);
- this.activeShapes.each(pb);
- this.activeShapes.reindexQuery(this.collideShapes);
- this.unlock(!1);
- this.processComponents(a);
- this.lock();
- for (d in this.cachedArbiters) this.arbiterSetFilter(this.cachedArbiters[d]) ||
- delete this.cachedArbiters[d];
- d = this.collisionSlop;
- k = 1 - Math.pow(this.collisionBias, a);
- for (c = 0; h.length > c; c++) h[c].preStep(a, d, k);
- for (c = 0; f.length > c; c++) d = f[c], d.preSolve(this), d.preStep(a);
- d = Math.pow(this.damping, a);
- k = this.gravity;
- for (c = 0; e.length > c; c++) e[c].velocity_func(k, d, a);
- a = 0 === b ? 0 : a / b;
- for (c = 0; h.length > c; c++) h[c].applyCachedImpulse(a);
- for (c = 0; f.length > c; c++) f[c].applyCachedImpulse(a);
- for (c = 0; this.iterations > c; c++) {
- for (a = 0; h.length > a; a++) h[a].applyImpulse();
- for (a = 0; f.length > a; a++) f[a].applyImpulse()
- }
- for (c =
- 0; f.length > c; c++) f[c].postSolve(this);
- for (c = 0; h.length > c; c++) h[c].handler.postSolve(h[c], this);
- this.unlock(!0)
- }
- };
- var Ia = function (a, b, c, d) {
- return new q(b.vx + -d.y * b.w - (a.vx + -c.y * a.w), b.vy + d.x * b.w - (a.vy + c.x * a.w))
- },
- Ea = function (a, b, c, d, e) {
- return (b.vx + -d.y * b.w - (a.vx + -c.y * a.w)) * e.x + (b.vy + d.x * b.w - (a.vy + c.x * a.w)) * e.y
- },
- za = function (a, b, c, d) {
- a.vx += b * a.m_inv;
- a.vy += c * a.m_inv;
- a.w += a.i_inv * (d.x * c - d.y * b)
- },
- U = function (a, b, c, d, e, f) {
- za(a, -e, -f, c);
- za(b, e, f, d)
- },
- Xa = function (a, b, c, d) {
- a.v_biasx += b * a.m_inv;
- a.v_biasy += c * a.m_inv;
- a.w_bias += a.i_inv * (d.x * c - d.y * b)
- },
- cb = function (a, b, c) {
- b = F(b, c);
- return a.m_inv + a.i_inv * b * b
- },
- ka = function (a, b, c, d, e) {
- a = cb(a, c, e) + cb(b, d, e);
- return f(0 !== a, "Unsolvable collision or constraint."), a
- },
- db = function (a, b, c, d, e, g) {
- var h;
- h = a.m_inv + b.m_inv;
- var k = a.i_inv,
- m = c.x * c.x * k;
- a = -c.x * c.y * k;
- c = h + c.y * c.y * k;
- h += m;
- k = b.i_inv;
- b = d.x * d.x * k;
- m = -d.x * d.y * k;
- c += d.y * d.y * k;
- d = 0 + a + m;
- a = 0 + a + m;
- h += b;
- b = c * h - d * a;
- f(0 !== b, "Unsolvable constraint.");
- b = 1 / b;
- e.x = h * b;
- e.y = -d * b;
- g.x = -a * b;
- g.y = c * b
- },
- H = c.Constraint = function (a, b) {
- this.a = a;
- this.b = b;
- this.next_b =
- this.next_a = this.space = null;
- this.maxForce = 1 / 0;
- this.errorBias = Math.pow(0.9, 60);
- this.maxBias = 1 / 0
- };
- H.prototype.activateBodies = function () {
- this.a && this.a.activate();
- this.b && this.b.activate()
- };
- H.prototype.preStep = function () {};
- H.prototype.applyCachedImpulse = function () {};
- H.prototype.applyImpulse = function () {};
- H.prototype.getImpulse = function () {
- return 0
- };
- H.prototype.preSolve = function () {};
- H.prototype.postSolve = function () {};
- H.prototype.next = function (a) {
- return this.a === a ? this.next_a : this.next_b
- };
- var la = c.PinJoint =
- function (a, b, c, d) {
- H.call(this, a, b);
- this.anchr1 = c;
- this.anchr2 = d;
- a = a ? A(a.p, E(c, a.rot)) : c;
- b = b ? A(b.p, E(d, b.rot)) : d;
- this.dist = x(y(b, a));
- f(0 < this.dist, "You created a 0 length pin joint. A pivot joint will be much more stable.");
- this.n = this.r1 = this.r2 = null;
- this.bias = this.jnAcc = this.jnMax = this.nMass = 0
- };
- la.prototype = Object.create(H.prototype);
- la.prototype.preStep = function (a) {
- var b = this.a,
- c = this.b;
- this.r1 = E(this.anchr1, b.rot);
- this.r2 = E(this.anchr2, c.rot);
- var d = y(A(c.p, this.r2), A(b.p, this.r1)),
- e = x(d);
- this.n =
- z(d, 1 / (e ? e : 1 / 0));
- this.nMass = 1 / ka(b, c, this.r1, this.r2, this.n);
- b = this.maxBias;
- this.bias = s(-(1 - Math.pow(this.errorBias, a)) * (e - this.dist) / a, -b, b);
- this.jnMax = this.maxForce * a
- };
- la.prototype.applyCachedImpulse = function (a) {
- a = z(this.n, this.jnAcc * a);
- U(this.a, this.b, this.r1, this.r2, a.x, a.y)
- };
- la.prototype.applyImpulse = function () {
- var a = this.a,
- b = this.b,
- c = this.n,
- d = Ea(a, b, this.r1, this.r2, c),
- d = (this.bias - d) * this.nMass,
- e = this.jnAcc;
- this.jnAcc = s(e + d, -this.jnMax, this.jnMax);
- d = this.jnAcc - e;
- U(a, b, this.r1, this.r2, c.x * d,
- c.y * d)
- };
- la.prototype.getImpulse = function () {
- return Math.abs(this.jnAcc)
- };
- var ma = c.SlideJoint = function (a, b, c, d, e, f) {
- H.call(this, a, b);
- this.anchr1 = c;
- this.anchr2 = d;
- this.min = e;
- this.max = f;
- this.r1 = this.r2 = this.n = null;
- this.bias = this.jnAcc = this.jnMax = this.nMass = 0
- };
- ma.prototype = Object.create(H.prototype);
- ma.prototype.preStep = function (a) {
- var b = this.a,
- c = this.b;
- this.r1 = E(this.anchr1, b.rot);
- this.r2 = E(this.anchr2, c.rot);
- var d = y(A(c.p, this.r2), A(b.p, this.r1)),
- e = x(d),
- f = 0;
- e > this.max ? (f = e - this.max, this.n = G(d)) : this.min >
- e ? (f = this.min - e, this.n = C(G(d))) : (this.n = w, this.jnAcc = 0);
- this.nMass = 1 / ka(b, c, this.r1, this.r2, this.n);
- b = this.maxBias;
- this.bias = s(-(1 - Math.pow(this.errorBias, a)) * f / a, -b, b);
- this.jnMax = this.maxForce * a
- };
- ma.prototype.applyCachedImpulse = function (a) {
- a *= this.jnAcc;
- U(this.a, this.b, this.r1, this.r2, this.n.x * a, this.n.y * a)
- };
- ma.prototype.applyImpulse = function () {
- if (0 !== this.n.x || 0 !== this.n.y) {
- var a = this.a,
- b = this.b,
- c = this.n,
- d = Ia(a, b, this.r1, this.r2),
- d = u(d, c),
- d = (this.bias - d) * this.nMass,
- e = this.jnAcc;
- this.jnAcc = s(e + d, -this.jnMax, 0);
- d = this.jnAcc - e;
- U(a, b, this.r1, this.r2, c.x * d, c.y * d)
- }
- };
- ma.prototype.getImpulse = function () {
- return Math.abs(this.jnAcc)
- };
- var na = c.PivotJoint = function (a, b, c, d) {
- if (H.call(this, a, b), void 0 === d) d = c, c = a ? a.world2Local(d) : d, d = b ? b.world2Local(d) : d;
- this.anchr1 = c;
- this.anchr2 = d;
- this.r1 = this.r2 = w;
- this.k1 = new q(0, 0);
- this.k2 = new q(0, 0);
- this.jAcc = w;
- this.jMaxLen = 0;
- this.bias = w
- };
- na.prototype = Object.create(H.prototype);
- na.prototype.preStep = function (a) {
- var b = this.a,
- c = this.b;
- this.r1 = E(this.anchr1, b.rot);
- this.r2 =
- E(this.anchr2, c.rot);
- db(b, c, this.r1, this.r2, this.k1, this.k2);
- this.jMaxLen = this.maxForce * a;
- b = y(A(c.p, this.r2), A(b.p, this.r1));
- this.bias = M(z(b, -(1 - Math.pow(this.errorBias, a)) / a), this.maxBias)
- };
- na.prototype.applyCachedImpulse = function (a) {
- U(this.a, this.b, this.r1, this.r2, this.jAcc.x * a, this.jAcc.y * a)
- };
- na.prototype.applyImpulse = function () {
- var a = this.a,
- b = this.b,
- c = Ia(a, b, this.r1, this.r2),
- c = y(this.bias, c),
- d = this.k2,
- c = new q(u(c, this.k1), u(c, d)),
- d = this.jAcc;
- this.jAcc = M(A(this.jAcc, c), this.jMaxLen);
- U(a, b, this.r1,
- this.r2, this.jAcc.x - d.x, this.jAcc.y - d.y)
- };
- na.prototype.getImpulse = function () {
- return x(this.jAcc)
- };
- var da = c.GrooveJoint = function (a, b, c, d, e) {
- H.call(this, a, b);
- this.grv_a = c;
- this.grv_b = d;
- this.grv_n = J(Q(y(d, c)));
- this.anchr2 = e;
- this.grv_tn = null;
- this.clamp = 0;
- this.r1 = this.r2 = null;
- this.k1 = new q(0, 0);
- this.k2 = new q(0, 0);
- this.jAcc = w;
- this.jMaxLen = 0;
- this.bias = null
- };
- da.prototype = Object.create(H.prototype);
- da.prototype.preStep = function (a) {
- var b = this.a,
- c = this.b,
- d = b.local2World(this.grv_a),
- e = b.local2World(this.grv_b),
- f = E(this.grv_n, b.rot),
- g = u(d, f);
- this.grv_tn = f;
- this.r2 = E(this.anchr2, c.rot);
- var h = F(A(c.p, this.r2), f);
- F(d, f) >= h ? (this.clamp = 1, this.r1 = y(d, b.p)) : h >= F(e, f) ? (this.clamp = -1, this.r1 = y(e, b.p)) : (this.clamp = 0, this.r1 = y(A(z(J(f), -h), z(f, g)), b.p));
- db(b, c, this.r1, this.r2, this.k1, this.k2);
- this.jMaxLen = this.maxForce * a;
- b = y(A(c.p, this.r2), A(b.p, this.r1));
- this.bias = M(z(b, -(1 - Math.pow(this.errorBias, a)) / a), this.maxBias)
- };
- da.prototype.applyCachedImpulse = function (a) {
- U(this.a, this.b, this.r1, this.r2, this.jAcc.x * a, this.jAcc.y *
- a)
- };
- da.prototype.grooveConstrain = function (a) {
- var b = this.grv_tn;
- a = 0 < this.clamp * F(a, b) ? a : P(a, b);
- return M(a, this.jMaxLen)
- };
- da.prototype.applyImpulse = function () {
- var a = this.a,
- b = this.b,
- c = Ia(a, b, this.r1, this.r2),
- c = y(this.bias, c),
- d = this.k2,
- c = new q(u(c, this.k1), u(c, d)),
- d = this.jAcc;
- this.jAcc = this.grooveConstrain(A(d, c));
- U(a, b, this.r1, this.r2, this.jAcc.x - d.x, this.jAcc.y - d.y)
- };
- da.prototype.getImpulse = function () {
- return x(this.jAcc)
- };
- da.prototype.setGrooveA = function (a) {
- this.grv_a = a;
- this.grv_n = J(Q(y(this.grv_b,
- a)));
- this.activateBodies()
- };
- da.prototype.setGrooveB = function (a) {
- this.grv_b = a;
- this.grv_n = J(Q(y(a, this.grv_a)));
- this.activateBodies()
- };
- var qb = function (a, b) {
- return (a.restLength - b) * a.stiffness
- },
- oa = c.DampedSpring = function (a, b, c, d, e, f, g) {
- H.call(this, a, b);
- this.anchr1 = c;
- this.anchr2 = d;
- this.restLength = e;
- this.stiffness = f;
- this.damping = g;
- this.springForceFunc = qb;
- this.target_vrn = this.v_coef = 0;
- this.r1 = this.r2 = null;
- this.nMass = 0;
- this.n = null
- };
- oa.prototype = Object.create(H.prototype);
- oa.prototype.preStep = function (a) {
- var b =
- this.a,
- c = this.b;
- this.r1 = E(this.anchr1, b.rot);
- this.r2 = E(this.anchr2, c.rot);
- var d = y(A(c.p, this.r2), A(b.p, this.r1)),
- e = x(d);
- this.n = z(d, 1 / (e ? e : 1 / 0));
- d = ka(b, c, this.r1, this.r2, this.n);
- f(0 !== d, "Unsolvable this.");
- this.nMass = 1 / d;
- this.target_vrn = 0;
- this.v_coef = 1 - Math.exp(-this.damping * a * d);
- e = this.springForceFunc(this, e);
- U(b, c, this.r1, this.r2, this.n.x * e * a, this.n.y * e * a)
- };
- oa.prototype.applyCachedImpulse = function () {};
- oa.prototype.applyImpulse = function () {
- var a = this.a,
- b = this.b,
- c = Ea(a, b, this.r1, this.r2, this.n),
- d = (this.target_vrn -
- c) * this.v_coef;
- this.target_vrn = c + d;
- d *= this.nMass;
- U(a, b, this.r1, this.r2, this.n.x * d, this.n.y * d)
- };
- oa.prototype.getImpulse = function () {
- return 0
- };
- var rb = function (a, b) {
- return (b - a.restAngle) * a.stiffness
- },
- Ja = c.DampedRotarySpring = function (a, b, c, d, e) {
- H.call(this, a, b);
- this.restAngle = c;
- this.stiffness = d;
- this.damping = e;
- this.springTorqueFunc = rb;
- this.iSum = this.w_coef = this.target_wrn = 0
- };
- Ja.prototype = Object.create(H.prototype);
- Ja.prototype.preStep = function (a) {
- var b = this.a,
- c = this.b,
- d = b.i_inv + c.i_inv;
- f(0 !== d, "Unsolvable spring.");
- this.iSum = 1 / d;
- this.w_coef = 1 - Math.exp(-this.damping * a * d);
- this.target_wrn = 0;
- a *= this.springTorqueFunc(this, b.a - c.a);
- b.w -= a * b.i_inv;
- c.w += a * c.i_inv
- };
- Ja.prototype.applyImpulse = function () {
- var a = this.a,
- b = this.b,
- c = a.w - b.w,
- d = (this.target_wrn - c) * this.w_coef;
- this.target_wrn = c + d;
- c = d * this.iSum;
- a.w += c * a.i_inv;
- b.w -= c * b.i_inv
- };
- var pa = c.RotaryLimitJoint = function (a, b, c, d) {
- H.call(this, a, b);
- this.min = c;
- this.max = d;
- this.iSum = this.bias = this.jMax = this.jAcc = 0
- };
- pa.prototype = Object.create(H.prototype);
- pa.prototype.preStep = function (a) {
- var b =
- this.a,
- c = this.b,
- d = c.a - b.a,
- e = 0;
- d > this.max ? e = this.max - d : this.min > d && (e = this.min - d);
- this.iSum = 1 / (1 / b.i + 1 / c.i);
- b = this.maxBias;
- this.bias = s(-(1 - Math.pow(this.errorBias, a)) * e / a, -b, b);
- this.jMax = this.maxForce * a;
- this.bias || (this.jAcc = 0)
- };
- pa.prototype.applyCachedImpulse = function (a) {
- var b = this.a,
- c = this.b;
- a *= this.jAcc;
- b.w -= a * b.i_inv;
- c.w += a * c.i_inv
- };
- pa.prototype.applyImpulse = function () {
- if (this.bias) {
- var a = this.a,
- b = this.b,
- c = -(this.bias + (b.w - a.w)) * this.iSum,
- d = this.jAcc;
- this.jAcc = 0 > this.bias ? s(d + c, 0, this.jMax) : s(d +
- c, -this.jMax, 0);
- c = this.jAcc - d;
- a.w -= c * a.i_inv;
- b.w += c * b.i_inv
- }
- };
- pa.prototype.getImpulse = function () {
- return Math.abs(joint.jAcc)
- };
- var qa = c.RatchetJoint = function (a, b, c, d) {
- H.call(this, a, b);
- this.angle = 0;
- this.phase = c;
- this.ratchet = d;
- this.angle = (b ? b.a : 0) - (a ? a.a : 0);
- this.iSum = this.bias = this.jAcc = this.jMax = 0
- };
- qa.prototype = Object.create(H.prototype);
- qa.prototype.preStep = function (a) {
- var b = this.a,
- c = this.b,
- d = this.phase,
- e = this.ratchet,
- f = c.a - b.a,
- g = this.angle - f,
- h = 0;
- 0 < g * e ? h = g : this.angle = Math.floor((f - d) / e) * e + d;
- this.iSum =
- 1 / (b.i_inv + c.i_inv);
- b = this.maxBias;
- this.bias = s(-(1 - Math.pow(this.errorBias, a)) * h / a, -b, b);
- this.jMax = this.maxForce * a;
- this.bias || (this.jAcc = 0)
- };
- qa.prototype.applyCachedImpulse = function (a) {
- var b = this.a,
- c = this.b;
- a *= this.jAcc;
- b.w -= a * b.i_inv;
- c.w += a * c.i_inv
- };
- qa.prototype.applyImpulse = function () {
- if (this.bias) {
- var a = this.a,
- b = this.b,
- c = this.ratchet,
- d = -(this.bias + (b.w - a.w)) * this.iSum,
- e = this.jAcc;
- this.jAcc = s((e + d) * c, 0, this.jMax * Math.abs(c)) / c;
- d = this.jAcc - e;
- a.w -= d * a.i_inv;
- b.w += d * b.i_inv
- }
- };
- qa.prototype.getImpulse =
- function (a) {
- return Math.abs(a.jAcc)
- };
- var ga = c.GearJoint = function (a, b, c, d) {
- H.call(this, a, b);
- this.phase = c;
- this.ratio = d;
- this.ratio_inv = 1 / d;
- this.iSum = this.bias = this.jMax = this.jAcc = 0
- };
- ga.prototype = Object.create(H.prototype);
- ga.prototype.preStep = function (a) {
- var b = this.a,
- c = this.b;
- this.iSum = 1 / (b.i_inv * this.ratio_inv + this.ratio * c.i_inv);
- var d = this.maxBias;
- this.bias = s(-(1 - Math.pow(this.errorBias, a)) * (c.a * this.ratio - b.a - this.phase) / a, -d, d);
- this.jMax = this.maxForce * a
- };
- ga.prototype.applyCachedImpulse = function (a) {
- var b =
- this.a,
- c = this.b;
- a *= this.jAcc;
- b.w -= a * b.i_inv * this.ratio_inv;
- c.w += a * c.i_inv
- };
- ga.prototype.applyImpulse = function () {
- var a = this.a,
- b = this.b,
- c = (this.bias - (b.w * this.ratio - a.w)) * this.iSum,
- d = this.jAcc;
- this.jAcc = s(d + c, -this.jMax, this.jMax);
- c = this.jAcc - d;
- a.w -= c * a.i_inv * this.ratio_inv;
- b.w += c * b.i_inv
- };
- ga.prototype.getImpulse = function () {
- return Math.abs(this.jAcc)
- };
- ga.prototype.setRatio = function (a) {
- this.ratio = a;
- this.ratio_inv = 1 / a;
- this.activateBodies()
- };
- var ra = c.SimpleMotor = function (a, b, c) {
- H.call(this, a, b);
- this.rate =
- c;
- this.iSum = this.jMax = this.jAcc = 0
- };
- ra.prototype = Object.create(H.prototype);
- ra.prototype.preStep = function (a) {
- this.iSum = 1 / (this.a.i_inv + this.b.i_inv);
- this.jMax = this.maxForce * a
- };
- ra.prototype.applyCachedImpulse = function (a) {
- var b = this.a,
- c = this.b;
- a *= this.jAcc;
- b.w -= a * b.i_inv;
- c.w += a * c.i_inv
- };
- ra.prototype.applyImpulse = function () {
- var a = this.a,
- b = this.b,
- c = -(b.w - a.w + this.rate) * this.iSum,
- d = this.jAcc;
- this.jAcc = s(d + c, -this.jMax, this.jMax);
- c = this.jAcc - d;
- a.w -= c * a.i_inv;
- b.w += c * b.i_inv
- };
- ra.prototype.getImpulse = function () {
- return Math.abs(this.jAcc)
- }
- })();
- var world, PHYS_SCALE = 1,
- RAD_TO_DEGREES = 180 / Math.PI,
- DEGREES_TO_RAD = Math.PI / 180,
- objA, objB, debugCanvas, debugDraw, space, v = cp.v,
- GRABABLE_MASK_BIT = -2147483648,
- NOT_GRABABLE_MASK = ~GRABABLE_MASK_BIT;
- function initPhysics(c) {
- isLevelEditor && isEditorDebug && (isPhysicsDebugDraw = !0);
- isPhysicsDebugDraw && !c && (debugCanvas = document.createElement("canvas"), debugCanvas.id = "debugCanvas", debugCanvas.width = 320, debugCanvas.height = 356, debugCanvas.style.position = "absolute", debugCanvas.style.left = "50%", debugCanvas.style.top = "10%", debugCanvas.style.zIndex = "1", debugCanvas.style.pointerEvents = "none", document.body.appendChild(debugCanvas), ChipMunkDebugDrawer.prototype.canvas = debugCanvas, ChipMunkDebugDrawer.prototype.ctx =
- debugCanvas.getContext("2d"), onWindowResize(null));
- debugDraw = new ChipMunkDebugDrawer;
- space = debugDraw.space;
- space.iterations = 10;
- space.gravity = v(0, 500);
- space.sleepTimeThreshold = 1;
- space.collisionSlop = 1;
- space.addCollisionHandler(1, 0, null, onSensorContactPreSolve, null, null);
- space.addCollisionHandler(2, 0, onGlassContactBegin, null, null, null);
- space.addCollisionHandler(2, 2, onGlassContactBegin, null, null, null);
- trace("reinit")
- }
- function onGlassContactBegin(c, a) {
- objA = c.body_a.userdata;
- objB = c.body_b.userdata;
- collidedGlass = collidedAim = null;
- if (objA && objB && (objA.isGlass ? (collidedGlass = objA, collidedAim = objB) : objB.isGlass && (collidedGlass = objB, collidedAim = objA), collidedGlass)) {
- (collidedBody = collidedAim.physBody) && collidedAim.physBody.isStatic() && (collidedBody = collidedGlass.physBody);
- if (!collidedBody) return !0;
- var b = collidedBody.vx,
- g = collidedBody.vy;
- Math.sqrt(b * b + g * g) > GLASS_BREAK_VELOCITY && (addToArray(clickedChars, collidedGlass),
- collidedAim.isGlass && addToArray(clickedChars, collidedAim))
- }
- return !0
- }
- function onSensorContactPreSolve(c, a, b) {
- objA = c.body_a.userdata;
- objB = c.body_b.userdata;
- collidedSensor = collidedAim = null;
- objA && objB && (c.a.sensor ? (collidedSensor = objA, collidedAim = objB) : c.b.sensor && (collidedSensor = objB, collidedAim = objA), collidedSensor && collidedSensor.isActivated && collidedAim.physBody && (dx = collidedAim.vis.x - collidedSensor.vis.x, dy = collidedAim.vis.y - collidedSensor.vis.y, dist = Math.sqrt(dx * dx + dy * dy), force = Math.max(0, 1 - dist / collidedSensor.activDistance), force = force * collidedSensor.activForce *
- collidedAim.physBody.m, angle = collidedSensor.vis.rotation * DEGREES_TO_RAD, collidedSensor.isReversed && (angle += Math.PI), collidedAim.physBody.applyImpulse(v(force * Math.cos(angle), force * Math.sin(angle)), cp.vzero)));
- return !0
- }
- var worldManifold, isCollideParticlesNeed = !0,
- collidedChar, collidedAim, collidedSensor, collidedBody, collidedGlass, force, angle, fixDef, bodyDef;
- function createCircleShape(c, a, b, g, f, d) {
- var e = !1,
- h = 0.5,
- k = 0.3;
- g === HERO_TYPE || g === HERO_DOC_TYPE ? k = 0.8 : g === FAN_TYPE && (e = !0, h = 0.8, k = 0);
- e ? (e = new cp.Body(Infinity, Infinity), e.nodeIdleTime = Infinity) : e = space.addBody(new cp.Body(1, cp.momentForCircle(1, 0, b, v(0, 0))));
- e.setPos(v(c, a));
- e.setAngle(f);
- c = space.addShape(new cp.CircleShape(e, b, v(0, 0)));
- c.setElasticity(k);
- c.setFriction(h);
- g === FAN_TYPE && (g = d.isReversed ? space.addShape(new cp.BoxShape2(e, new cp.BB(-d.activDistance, -15, 0, 15))) : space.addShape(new cp.BoxShape2(e,
- new cp.BB(0, -15, d.activDistance, 15))), g.setSensor(!0), g.setCollisionType(1));
- return e
- }
- var DEFAULT_RECT_SIZE = 90 / PHYS_SCALE,
- DEFAULT_BOX_SIZE = 52 / PHYS_SCALE;
- function createRectPhysics(c, a, b, g, f, d) {
- var e = DEFAULT_RECT_SIZE,
- h = DEFAULT_RECT_SIZE,
- k = !1,
- m = 0.6,
- n = 0,
- p = 0.0010;
- f === PHYSICS_RECT_TYPE ? k = !0 : f === DYNAMIC_BOX_TYPE ? (h = e = DEFAULT_BOX_SIZE, m = 0.8) : f === HARD_BOX_TYPE ? (e = 30 / PHYS_SCALE, h = 30 / PHYS_SCALE, m = 0.8) : f === STATIC_BOX_TYPE ? (e = 30 / PHYS_SCALE, h = 30 / PHYS_SCALE, m = 0.8, k = !0) : f === DANGER_TYPE ? (e = 100 / PHYS_SCALE, h = 18 / PHYS_SCALE) : f === PHYSICS_MAN_BLOCK_TYPE ? (e = 194 / PHYS_SCALE, h = 23 / PHYS_SCALE) : f === GLASS_BLOCK_TYPE ? (e = 103 / PHYS_SCALE, h = 20 / PHYS_SCALE, n = 2) : f === GLASS_BOX_TYPE ? (e =
- 30 / PHYS_SCALE, h = 30 / PHYS_SCALE, n = 2) : f === DOOR_TYPE ? (e = 122 / PHYS_SCALE, h = 18 / PHYS_SCALE) : f === DYNAMIC_RECT_TYPE ? (e = 109 / PHYS_SCALE, h = 20 / PHYS_SCALE, m = 0.8) : f === HARD_RECT_TYPE ? (e = 109 / PHYS_SCALE, h = 20 / PHYS_SCALE, m = 0.8, p = 1 / 1500) : f === STATIC_BALK_1_TYPE && (e = 109 / PHYS_SCALE, h = 20 / PHYS_SCALE, m = 0.8, k = !0);
- b *= e;
- g *= h;
- k ? (k = new cp.Body(Infinity, Infinity), k.nodeIdleTime = Infinity) : (k = b * g * p, k = space.addBody(new cp.Body(k, cp.momentForBox(k, b, g))));
- k.setPos(v(c, a));
- k.setAngle(d);
- c = space.addShape(new cp.BoxShape(k, b, g));
- c.setCollisionType(n);
- c.setFriction(m);
- c.setElasticity(0);
- return k
- }
- function createKinematicPhysics(c, a, b, g, f, d, e) {
- b = 0.8;
- var h = 0,
- k = 0,
- m;
- m = new cp.Body(Infinity, Infinity);
- m.setPos(v(c, a));
- m.setAngle(d);
- f === TELEGA_TYPE ? (h = 105 / PHYS_SCALE * g, k = 20 / PHYS_SCALE * g, e = 0, c = space.addShape(new cp.BoxShape2(m, new cp.BB(-h / 2, e * g, h / 2, k + e))), c.setFriction(b), c.setElasticity(0), e = 20, c = space.addShape(new cp.BoxShape2(m, new cp.BB(-h / 2, -20 * g, -h / 2 + e, k))), c.setFriction(1), c.setElasticity(0), c = space.addShape(new cp.BoxShape2(m, new cp.BB(h / 2 - e, -20 * g, h / 2, k))), c.setFriction(0), c.setElasticity(0)) :
- f === AIM_TYPE ? (h = 50 / PHYS_SCALE * g, k = 40 / PHYS_SCALE * g, b = 0.2, c = (a = e.isReversed) ? space.addShape(new cp.SegmentShape(m, v(h / 2, k / 2), v(h / 2 - 3 * g, -16 * g), 3)) : space.addShape(new cp.SegmentShape(m, v(-h / 2, k / 2), v(-h / 2 + 3 * g, -16 * g), 3)), c.setFriction(b), c.setElasticity(0), c = a ? space.addShape(new cp.SegmentShape(m, v(h / 2 - 8 * g, -19 * g), v(-10 * g, -40 * g), 3)) : space.addShape(new cp.SegmentShape(m, v(-h / 2 + 8 * g, -19 * g), v(10 * g, -40 * g), 3)), c.setFriction(b), c.setElasticity(0), c = a ? space.addShape(new cp.SegmentShape(m, v(-10 * g, -40 * g), v(-35 * g, -40 * g), 3)) : space.addShape(new cp.SegmentShape(m, v(10 * g, -40 * g), v(35 * g, -40 * g), 3)), c.setFriction(b), c.setElasticity(0.7), e.isMovable && (c = a ? space.addShape(new cp.SegmentShape(m, v(-97 * g, 37 * g), v(25 * g, 37 * g), 4)) : space.addShape(new cp.SegmentShape(m, v(-25 * g, 37 * g), v(97 * g, 37 * g), 4)), c.setFriction(b), c.setElasticity(0))) : f === MOVABLE_BALK_TYPE && (h = 105 / PHYS_SCALE * g, k = 20 / PHYS_SCALE * g, c = space.addShape(new cp.BoxShape2(m, new cp.BB(-h / 2, -k / 2, h / 2, k / 2))), c.setFriction(b), c.setElasticity(0));
- return m
- }
- function createSegmentPhysics(c, a, b, g, f, d, e) {
- e = new cp.Body(Infinity, Infinity);
- e.nodeIdleTime = Infinity;
- e.setPos(v(c, a));
- e.setAngle(d);
- f === LAND_TYPE && (c = space.addShape(new cp.SegmentShape(e, v(-60 * b, -22 * g), v(60 * b, -22 * g), 5)), c.setFriction(0.8), c.setElasticity(0));
- return e
- }
- function createTrianglePhysics(c, a, b, g, f, d) {
- var e = 0;
- b *= 51;
- var h = 45 * g;
- g = [-b / 2, -h / 2, 0, h / 2, b / 2, -h / 2];
- b = 0.0010 * b * h;
- b = space.addBody(new cp.Body(b, cp.momentForPoly(b, g, cp.vzero)));
- g = space.addShape(new cp.PolyShape(b, g, cp.vzero));
- g.setFriction(0.6);
- g.setElasticity(0);
- f === GLASS_TRIANGLE_TYPE && (e = 2);
- g.setCollisionType(e);
- b.setPos(v(c, a));
- b.setAngle(d);
- return b
- }
- var querySelectedBody, queryV = new v(0, 0);
- function getBodyAtMouse(c, a) {
- querySelectedBody = null;
- queryV.x = c;
- queryV.y = a;
- var b = this.space.nearestPointQueryNearest(queryV, 100, cp.ALL_LAYERS, cp.NO_GROUP);
- b && 0 > b.d && b.shape && b.shape.body && (querySelectedBody = b.shape.body);
- return querySelectedBody
- }
- function destroyBody(c) {
- var a;
- if (c.isStatic())
- for (; 0 < c.shapeList.length;) a = c.shapeList[0], space.removeStaticShape(a);
- else {
- for (; 0 < c.shapeList.length;) a = c.shapeList[0], a.space && space.removeShape(a);
- c.space && space.removeBody(c)
- }
- }
- function awakeAllBodies() {
- for (var c, a = allChars.length - 1; 0 <= a; --a) c = allChars[a], c.physBody && c.physBody.activate()
- }
- var ChipMunkDebugDrawer = function () {
- this.space = new cp.Space;
- this.fps = this.remainder = 0;
- this.mouse = v(0, 0);
- this.drawTime = this.simulationTime = 0;
- this.scale = 1;
- this.width = minW;
- this.height = minH;
- var c = this;
- this.canvas2point = function (a, b) {
- return v(a / c.scale, 480 - b / c.scale)
- };
- this.point2canvas = function (a) {
- return v(a.x * c.scale, a.y * c.scale)
- }
- };
- ChipMunkDebugDrawer.prototype.drawInfo = function () {
- var c = this.space,
- a = this.width - 20;
- this.ctx.textAlign = "start";
- this.ctx.textBaseline = "alphabetic";
- this.ctx.fillStyle = "black";
- var b = Math.floor(10 * this.fps) / 10;
- 0 === c.activeShapes.count && (b = "--");
- this.ctx.fillText("FPS: " + b, 10, 50, a);
- this.ctx.fillText("Step: " + c.stamp, 10, 80, a);
- b = c.arbiters.length;
- this.maxArbiters = this.maxArbiters ? Math.max(this.maxArbiters, b) : b;
- this.ctx.fillText("Arbiters: " + b + " (Max: " + this.maxArbiters + ")", 10, 110, a);
- for (var g = 0, f = 0; f < b; f++) g +=
- c.arbiters[f].contacts.length;
- this.maxContacts = this.maxContacts ? Math.max(this.maxContacts, g) : g;
- this.ctx.fillText("Contact points: " + g + " (Max: " + this.maxContacts + ")", 10, 140, a);
- this.ctx.fillText("Simulation time: " + this.simulationTime + " ms", 10, 170, a);
- this.ctx.fillText("Draw time: " + this.drawTime + " ms", 10, 200, a);
- this.message && this.ctx.fillText(this.message, 10, this.height - 50, a)
- };
- ChipMunkDebugDrawer.prototype.draw = function () {
- var c = this.ctx,
- a = this;
- a.scale = scaleFactor;
- c.strokeStyle = "black";
- c.clearRect(0, 0, debugCanvas.width, debugCanvas.height);
- this.ctx.font = "16px sans-serif";
- this.ctx.lineCap = "round";
- this.space.eachShape(function (b) {
- c.fillStyle = b.style();
- b.draw(c, a.scale, a.point2canvas)
- });
- this.space.eachConstraint(function (b) {
- b.draw && b.draw(c, a.scale, a.point2canvas)
- })
- };
- var drawSegment = function (c, a, b) {
- var g = this.ctx;
- g.beginPath();
- c = this.point2canvas(c);
- a = this.point2canvas(a);
- g.moveTo(c.x, c.y);
- g.lineTo(a.x, a.y);
- g.lineWidth = 1;
- g.strokeStyle = b;
- g.stroke()
- },
- drawBB = function (c, a, b) {
- var g = this.ctx,
- f = this.point2canvas(v(c.l, c.t)),
- d = this.scale * (c.r - c.l);
- c = this.scale * (c.t - c.b);
- a && (g.fillStyle = a, g.fillRect(f.x, f.y, d, c));
- b && (g.strokeStyle = b, g.strokeRect(f.x, f.y, d, c))
- },
- drawCircle = function (c, a, b, g, f) {
- g = b(g);
- c.beginPath();
- c.arc(g.x, g.y, a * f, 0, 2 * Math.PI, !1);
- c.fill();
- c.stroke()
- },
- drawLine =
- function (c, a, b, g) {
- b = a(b);
- g = a(g);
- c.beginPath();
- c.moveTo(b.x, b.y);
- c.lineTo(g.x, g.y);
- c.stroke()
- },
- drawRect = function (c, a, b, g) {
- var f = a(b);
- a = cp.v.sub(a(cp.v.add(b, g)), f);
- c.fillRect(f.x, f.y, a.x, a.y)
- },
- springPoints = [v(0, 0), v(0.2, 0), v(0.25, 3), v(0.3, -6), v(0.35, 6), v(0.4, -6), v(0.45, 6), v(0.5, -6), v(0.55, 6), v(0.6, -6), v(0.65, 6), v(0.7, -3), v(0.75, 6), v(0.8, 0), v(1, 0)],
- drawSpring = function (c, a, b, g, f) {
- g = b(g);
- f = b(f);
- c.beginPath();
- c.moveTo(g.x, g.y);
- f = v.sub(f, g);
- b = v.len(f);
- f = v.mult(f, 1 / b);
- for (var d = 1; d < springPoints.length; d++) {
- var e =
- v.add(g, v.rotate(v(springPoints[d].x * b, springPoints[d].y * a), f));
- c.lineTo(e.x, e.y)
- }
- c.stroke()
- };
- cp.PolyShape.prototype.draw = function (c, a, b) {
- c.beginPath();
- a = this.tVerts;
- var g = a.length,
- f = b(new cp.Vect(a[g - 2], a[g - 1]));
- c.moveTo(f.x, f.y);
- for (f = 0; f < g; f += 2) {
- var d = b(new cp.Vect(a[f], a[f + 1]));
- c.lineTo(d.x, d.y)
- }
- c.fill();
- c.stroke()
- };
- cp.SegmentShape.prototype.draw = function (c, a, b) {
- var g = c.lineWidth;
- c.lineWidth = Math.max(1, 2 * this.r * a);
- drawLine(c, b, this.ta, this.tb);
- c.lineWidth = g
- };
- cp.CircleShape.prototype.draw = function (c, a, b) {
- drawCircle(c, a, b, this.tc, this.r);
- drawLine(c, b, this.tc, cp.v.mult(this.body.rot, this.r)
- .add(this.tc))
- };
- cp.PinJoint.prototype.draw = function (c, a, b) {
- a = this.a.local2World(this.anchr1);
- var g = this.b.local2World(this.anchr2);
- c.lineWidth = 2;
- c.strokeStyle = "grey";
- drawLine(c, b, a, g)
- };
- cp.SlideJoint.prototype.draw = function (c, a, b) {
- a = this.a.local2World(this.anchr1);
- var g = this.b.local2World(this.anchr2),
- f = v.add(a, v.clamp(v.sub(g, a), this.min));
- c.lineWidth = 2;
- c.strokeStyle = "grey";
- drawLine(c, b, a, g);
- c.strokeStyle = "red";
- drawLine(c, b, a, f)
- };
- cp.PivotJoint.prototype.draw = function (c, a, b) {
- var g = this.a.local2World(this.anchr1),
- f = this.b.local2World(this.anchr2);
- c.strokeStyle = "grey";
- c.fillStyle = "grey";
- drawCircle(c, a, b, g, 2);
- drawCircle(c, a, b, f, 2)
- };
- cp.GrooveJoint.prototype.draw = function (c, a, b) {
- var g = this.a.local2World(this.grv_a),
- f = this.a.local2World(this.grv_b),
- d = this.b.local2World(this.anchr2);
- c.strokeStyle = "grey";
- drawLine(c, b, g, f);
- drawCircle(c, a, b, d, 3)
- };
- cp.DampedSpring.prototype.draw = function (c, a, b) {
- var g = this.a.local2World(this.anchr1),
- f = this.b.local2World(this.anchr2);
- c.strokeStyle = "grey";
- drawSpring(c, a, b, g, f)
- };
- for (var randColor = function () {
- return Math.floor(256 * Math.random())
- }, debugAlpha = 0.7, styles = [], i = 0; 100 > i; i++) styles.push("rgba(" + randColor() + ", " + randColor() + ", " + randColor() + "," + debugAlpha + ")");
- cp.Shape.prototype.style = function () {
- var c;
- if (this.sensor) return "rgba(255,255,255,0)";
- c = this.body;
- return c.isSleeping() ? "rgba(50,50,50," + debugAlpha + ")" : c.nodeIdleTime > this.space.sleepTimeThreshold ? "rgba(170,170,170," + debugAlpha + ")" : styles[this.hashid % styles.length]
- };
- var MINIMUM_SPEED = 3,
- MAX_SPEED = 6,
- IS_NITRO = !1,
- DEFAULT_STATE = 0,
- COLLIDED_STATE = 1,
- ACTIVATOR_RADIUS = 25,
- MORE_EASY_MULT = 1,
- dx, dy, dist, isNeedActivate = !1;
- (function (c) {
- function a(a, b, c, e, h) {
- var k = new createjs.Sprite(zoeSS);
- k.baseBlock = this;
- this.vis = k;
- k = new createjs.Sprite(zoeSS);
- k.baseBlock = this;
- this.additVision = k;
- this.reset(a, b, c, e, h)
- }
- var b = a.prototype;
- b.reset = function (a, b, d, e, h) {
- this.typeId = a;
- this.type = c[a];
- createjs.Tween.removeTweens(this.vis);
- removeFromParent(this.additVision);
- this.parent = b;
- this.vis.isOnTop = !1;
- this.vis.isOnBottom = !0;
- this.isMovable = this.isFly = !1;
- this.teleportPartner = null;
- this.isReversed = !1;
- this.dir = 1;
- this.activForce = FAN_MAX_FORCE;
- this.activDistance = FAN_ACTIV_DISTANCE;
- this.distanceStartX = this.distanceEndX = 0;
- this.isRemovable = this.isClicked = !1;
- this.doorDistanceEnd = 0;
- this.isMechanic = this.isActivated = this.isGlass = !1;
- this.labelId = "";
- this.isMonster = !1;
- this.isRectMonster = !0;
- this.isNeedDispose = !1;
- this.teleportationStatus = -1;
- this.vis.alpha = 1;
- this.vis.mouseEnabled = !1;
- this.physBody = null;
- this.scale = d;
- this.scaleY = e;
- this.isEnemy = !1;
- this.additParams = h;
- this.aimTeleport = this.startTeleport = null;
- this.isFirstCollided = this.isTeleport = this.isDanger =
- this.isAim = !1;
- this.shape = null;
- this.defaultRotation = 0;
- this.animMargin = 30 * Math.random();
- this.isNeutralEnemy = !1;
- this.startMarginX = this.startMoveX = this.visionWidth = this.currSpeed = 0;
- this.state = DEFAULT_STATE;
- this.collideTimer = this.charRadius = 0;
- this.isExploded = !1;
- this.lastColliderType = -1;
- this.raduis = this.vis.rotation = 0;
- this.isDied = !1;
- this.forceToFly = this.vel = null;
- this.isByPhysPosUpdate = !0;
- this.vis.cursor = null;
- this.isLand = this.isHero = !1;
- this.lastAngularVelocity = this.lastVelocity = 0;
- this.isHelp = -1 < a.indexOf("HELP");
- this.isDynamicDecor = (this.isDecor = -1 < a.indexOf("DECOR")) ? this.isDynDecor() : !0;
- this.isPhysStatic = -1 < a.indexOf("PHYSICS");
- this.vis.visible = !this.isPhysStatic;
- this.type === LAND_TYPE && (this.isLand = !0);
- this.setVisionByType();
- this.updateVisionScale();
- !this.isDynamicDecor && isWithCache && (this.parent = allBgContainer);
- this.parent.addChild(this.vis)
- };
- b.isDynDecor = function () {
- return this.isHelp || this.type === DECOR_ARROW_TYPE
- };
- b.setupMouseEventListeners = function () {
- this.vis.cursor = "pointer"
- };
- b.setVisionByType = function () {
- this.vis.gotoAndStop(this.typeId);
- var a = !1;
- if (this.type === DYNAMIC_BOX_TYPE || this.type === DYNAMIC_RECT_TYPE || this.type === DYNAMIC_TRIANGLE_TYPE) a = this.isRemovable = !0;
- if (this.type === HARD_BOX_TYPE || this.type === HARD_RECT_TYPE || this.type === LAND_TYPE || this.type === STATIC_BALK_1_TYPE) a = !0;
- this.type === STATIC_BOX_TYPE && "INVIS" == this.getAdditParams(0) && (this.vis.visible = !1);
- this.type === HERO_TYPE ? (this.isHero = !0, this.vis.play(), this.isByPhysPosUpdate = !0, addToArray(allHeroes, this)) : this.type === BOMB_TYPE ? (this.vis.cursor = "pointer", this.vis.mouseEnabled = !0, this.activDistance = parseInt(this.getAdditParams(0)), this.activForce = parseInt(this.getAdditParams(1)), addToArray(allBombs, this)) : this.type === GLASS_BLOCK_TYPE || this.type === GLASS_BOX_TYPE || this.type === GLASS_TRIANGLE_TYPE ? this.isGlass = !0 : this.type === TELEGA_TYPE ? (this.readMovableConfig(1), this.isMovable = !0, this.visionWidth = 106, "1" !== this.getAdditParams(0) && (this.isRemovable = a = !0)) : this.type === MOVABLE_BALK_TYPE ? (this.readMovableConfig(0), this.isMovable = !0, this.visionWidth = 106, this.vis.gotoAndStop("STATIC_BALK_1_TYPE")) :
- this.type === STATIC_BALK_1_TYPE ? 0 < this.getAdditParams(0)
- .length && (this.isRemovable = !0) : this.type === FAN_TYPE && (this.vis.cursor = "pointer", this.vis.mouseEnabled = !0, addToArray(allFans, this), this.isByPhysPosUpdate = !1);
- this.isRemovable && (this.vis.cursor = "pointer", this.vis.mouseEnabled = !0, currentRemovablesNum++);
- this.type === AIM_TYPE && (this.isAim = !0, this.visionWidth = 65, this.additVision.gotoAndStop("AIM_BACK"), this.parent.addChildAt(this.additVision, 0), "REV" == this.getAdditParams(0) && (this.isReversed = !0), this.getAdditParams(1) &&
- (this.readMovableConfig(2), this.isMovable = !0, this.vis.gotoAndStop("AIM_TYPE_MOVABLE")));
- this.type === DANGER_TYPE && (this.isDanger = !0, this.isDynamicDecor = !1);
- if (this.type === TELEPORT_TYPE) {
- this.vis.play();
- this.isByPhysPosUpdate = !1;
- this.isTeleport = !0;
- this.labelId = this.getAdditParams(0);
- addToArray(allTeleports, this);
- for (var b = allTeleports.length - 1; 0 <= b; --b) {
- var c = allTeleports[b];
- c.labelId === this.labelId && (c.teleportPartner = this, this.teleportPartner = c)
- }
- }
- this.type === FAN_TYPE && ("REV" == this.getAdditParams(0) &&
- (this.isReversed = !0, this.dir = -1), this.getAdditParams(1) && (this.activDistance = parseInt(this.getAdditParams(1))), this.getAdditParams(2) && (this.activForce = parseInt(this.getAdditParams(2))));
- a && 0 < this.getAdditParams(0)
- .length && this.vis.gotoAndStop(this.typeId + "_" + this.getAdditParams(0));
- this.vis.paused || (this.vis.currentAnimationFrame = Math.floor(20 * Math.random()))
- };
- b.readMovableConfig = function (a) {
- this.dir = "R" === this.getAdditParams(0) ? 1 : -1;
- var b = parseInt(this.getAdditParams(1 + a));
- this.startMarginX = 1E3 <=
- b ? 1E3 - b : b;
- this.currSpeed = parseInt(this.getAdditParams(2 + a)) / 10
- };
- b.getAdditParams = function (a) {
- return this.additParams[0].split("_")
- .length > a ? this.additParams[0].split("_")[a] : null
- };
- b.setupActivLabel = function () {
- this.labelId = this.getAdditParams(0)
- };
- b.bombClick = function (a) {
- isLevelCompleted || isLevelFailed || isGamePaused || this.isExploded || (createExplosion(this), this.vis.removeAllEventListeners(), this.vis.mouseEnabled = !1, this.vis.scaleX = this.vis.scaleY = this.scale = 2, this.vis.gotoAndPlay("bombexplosionv"),
- addToParent(this.vis, this.parent), this.isByPhysPosUpdate = !1, this.disposePhysBody(), this.isExploded = !0, playSound("explodeSound"))
- };
- b.calculateBoundingBox = function () {
- var a = 1;
- this.isEnemy && (a = 0.7);
- var b = this.vis._animation;
- b && b.frames && 0 < b.frames.length && (this.bounds = charSS.getFrameBounds(b.frames[0]), this.bounds.width = this.bounds.width * this.scale * a, this.bounds.height = this.bounds.height * this.scale * a, this.bounds.x = this.bounds.x * this.scale * a, this.bounds.y = this.bounds.y * this.scale * a, this.charRadius = this.bounds.width /
- 2)
- };
- b.setPosition = function (a, b, c) {
- var e = a;
- this.isMovable && (this.distanceEndX = 140 * this.scale - this.scaleY * this.visionWidth, this.distanceStartX = a - this.distanceEndX / 2, this.distanceEndX = a + this.distanceEndX / 2, e = Math.min(this.distanceEndX, Math.max(this.distanceStartX, a + this.startMarginX)));
- this.vis.x = this.additVision.x = e;
- this.vis.y = this.additVision.y = b;
- this.defaultRotation = this.vis.rotation = this.additVision.rotation = c
- };
- b.initPhysics = function () {
- if (!this.isDecor && this.type !== ACTIVATOR_TYPE && this.type !== TELEPORT_TYPE) {
- var a;
- a = this.vis.x / PHYS_SCALE;
- var b = this.vis.y / PHYS_SCALE,
- c = this.vis.rotation * DEGREES_TO_RAD;
- if (a = this.isPhysStatic || this.type === DYNAMIC_BOX_TYPE || this.type === DANGER_TYPE || this.type === MONSTER_TYPE && this.isRectMonster || this.type === GLASS_BLOCK_TYPE || this.type === GLASS_BOX_TYPE || this.type === DOOR_TYPE || this.type === DYNAMIC_RECT_TYPE || this.type === HARD_RECT_TYPE || this.type === HARD_BOX_TYPE || this.type === STATIC_BALK_1_TYPE || this.type === STATIC_BOX_TYPE ? createRectPhysics(a, b, this.scale, this.scaleY, this.type, c) : this.type ===
- DYNAMIC_TRIANGLE_TYPE || this.type === GLASS_TRIANGLE_TYPE || this.type === HARD_TRIANGLE_TYPE ? createTrianglePhysics(a, b, this.scale, this.scaleY, this.type, c) : this.type === TELEGA_TYPE || this.type === AIM_TYPE || this.type === MOVABLE_BALK_TYPE ? createKinematicPhysics(a, b, this.scale, this.scaleY, this.type, c, this) : this.type === LAND_TYPE ? createSegmentPhysics(a, b, this.scale, this.scaleY, this.type, c, this) : createCircleShape(a, b, this.scale * this.getRadiusByType() / PHYS_SCALE, this.type, c, this)) a.userdata = this, this.physBody = a
- }
- };
- b.getRadiusByType = function () {
- switch (this.type) {
- case HERO_TYPE:
- return 32;
- case AIM_TYPE:
- return 19;
- case HERO_DOC_TYPE:
- return 31;
- case HERO_WOMAN_TYPE:
- return 31;
- case TELEPORT_TYPE:
- return 25;
- case BOMB_TYPE:
- return 20;
- case MONSTER_TYPE:
- return 31;
- case DYNAMIC_CIRCLE_TYPE:
- return 16;
- case FAN_TYPE:
- return 25
- }
- return 0
- };
- b.setFrame = function (a, b) {
- b ? this.vis.gotoAndPlay(a) : this.vis.gotoAndStop(a)
- };
- b.setVisionState = function (a) {};
- b.onInflateEnd = function () {
- this.isFly = !1
- };
- b.tick = function () {
- if (this.isNeedDispose) addToArray(toDisposeChars,
- this);
- else if (!isGamePaused && (!this.isDecor || this.isDynamicDecor))
- if (this.physBody && !this.isPhysStatic && this.isByPhysPosUpdate && (this.isMovable && (this.vis.x > this.distanceEndX ? this.dir = -1 : this.vis.x < this.distanceStartX && (this.dir = 1), this.physBody.setVel(v(15 * this.currSpeed * this.dir * dtScale, 0)), this.physBody.p.x += this.currSpeed * this.dir * dtScale), this.vis.x = this.additVision.x = this.physBody.p.x, this.vis.y = this.additVision.y = this.physBody.p.y, this.vis.rotation = this.additVision.rotation = Math.atan2(this.physBody.rot.y,
- this.physBody.rot.x) * RAD_TO_DEGREES), this.type === BOMB_TYPE ? (this.vis.scaleX = this.scale + Math.cos((counter + this.animMargin) / 5) / 60, this.vis.scaleY = this.scale - Math.cos((counter + this.animMargin) / 5) / 60, this.isExploded && 13 <= this.vis.currentAnimationFrame && (this.isNeedDispose = !0)) : this.isHelp && (this.vis.scaleX = this.vis.scaleY = this.scale + Math.cos((counter + this.animMargin) / 12) / 20), this.isHero && (this.updateTeleportation(), (-50 > this.vis.x || 410 < this.vis.x || this.vis.y > viewportH + 40 || -140 > this.vis.y) && this.dieByWorldOut()),
- this.type === AIM_TYPE)
- for (var a = 0; a < allHeroesLen; a++) {
- var b = allHeroes[a];
- if (25 > Math.abs(b.vis.x - this.vis.x) && 10 > Math.abs(b.vis.y - this.vis.y)) {
- if (isLevelCompleted && !isLevelFailed) break;
- trace("level complete!");
- this.aimCollected();
- updateShare(currentLevel + 1);
- showLevelCompleteWin();
- // updateShare(currentLevel + 1);Play68.setRankingScoreDesc(currentLevel + 1,Play68.rankingShowType.RANKING_SHOW_NO);
- }
- } else if (this.type === TELEPORT_TYPE)
- for (a = 0; a < allHeroesLen; a++) b = allHeroes[a], 40 > Math.abs(b.vis.x - this.vis.x) && 40 > Math.abs(b.vis.y - this.vis.y) ? b.teleportTo(this) : 0 > b.teleportationStatus && b.teleportContactEnd(this)
- };
- b.updateTeleportation = function () {
- if (this.physBody)
- if (0 ===
- this.teleportationStatus) {
- this.isByPhysPosUpdate = !1;
- this.teleportationStatus = 1;
- this.physBody.p.x = -1E3;
- this.physBody.p.y = 0;
- var a = this;
- playSound("portalAppearSound");
- createjs.Tween.get(this.vis, {
- override: !0
- })
- .to({
- rotation: 900,
- scaleX: 0.05,
- scaleY: 0.05,
- x: this.startTeleport.vis.x,
- y: this.startTeleport.vis.y
- }, 700)
- .to({
- x: this.aimTeleport.vis.x,
- y: this.aimTeleport.vis.y
- }, 0)
- .call(function () {})
- .to({
- rotation: 0,
- scaleX: this.scale,
- scaleY: this.scale
- }, 700)
- .call(function () {
- a.teleportationStatus = 2
- })
- } else 2 == this.teleportationStatus &&
- (this.physBody.p.x = this.aimTeleport.vis.x / PHYS_SCALE, this.physBody.p.y = this.aimTeleport.vis.y / PHYS_SCALE, this.physBody.w = 0, this.physBody.setAngle(0), this.physBody.setVel(v(0, 0)), this.teleportationStatus = -1, this.isByPhysPosUpdate = !0)
- };
- b.updateVisionScale = function () {
- this.vis.scaleX = this.scale;
- this.vis.scaleY = this.scaleY;
- this.isMovable && (this.vis.scaleX = this.vis.scaleY = this.scaleY);
- this.isReversed && (this.vis.scaleX *= -1);
- this.additVision.scaleX = this.vis.scaleX;
- this.additVision.scaleY = this.vis.scaleY
- };
- b.dispose = function () {
- removeFromArray(allChars, this);
- this.isHero && removeFromArray(allHeroes, this);
- this.lastColliderType = -1;
- addToDisposed(this);
- this.vis.removeAllEventListeners();
- this.disposePhysBody();
- this.shape = null;
- this.vis.stop();
- removeFromParent(this.vis);
- removeFromParent(this.additVision)
- };
- b.collideWithOtherDynamic = function () {
- -1 < this.teleportationStatus || (this.isByPhysPosUpdate = !0)
- };
- b.toggleFly = function () {};
- b.heroRejoicing = function () {
- this.vis.gotoAndPlay(this.typeId)
- };
- b.aimCollected = function () {
- createPrerenderedPart(this.vis.x,
- this.vis.y, 1.4, "parteffectv3", 0.71, this.vis, 0.8);
- addAchiev(GREAT_START_ACHIEV)
- };
- b.teleportTo = function (a) {
- this.aimTeleport || (this.startTeleport = a, this.aimTeleport = a.teleportPartner, this.teleportationStatus = 0)
- };
- b.teleportContactEnd = function (a) {
- this.aimTeleport === a && (this.aimTeleport = this.startTeleport = null)
- };
- b.die = function () {
- isLevelCompleted || isLevelFailed || (this.isDied = isLevelFailed = !0, this.isByPhysPosUpdate = this.isFly = !1, hideGameInterface(), createjs.Tween.get(this.vis, {
- override: !0
- })
- .to({
- alpha: 0,
- scaleX: 0,
- scaleY: 0,
- rotation: 900
- }, 1200)
- .wait(400)
- .call(showRestartWin), createDiePart(this.vis.x, this.vis.y), this.physBody && (this.physBody.p.x = -1E3), playSound("restartSound"))
- };
- b.dieByWorldOut = function () {
- isLevelCompleted || isLevelFailed || (1 >= allHeroes.length ? (this.isDied = isLevelFailed = !0, this.isByPhysPosUpdate = this.isFly = !1, hideGameInterface(), createjs.Tween.get(this.vis)
- .wait(400)
- .call(showRestartWin), this.physBody && (this.physBody.p.x = -1E3), playSound("restartSound")) : this.isNeedDispose = !0)
- };
- b.collideWithDyn =
- function (a) {
- this.isFirstCollided || (this.isByPhysPosUpdate = this.isFirstCollided = !0)
- };
- b.breakGlass = function () {
- !this.vis.visible || 15 > levelStartTimer || !this.physBody || (this.disposePhysBody(), this.vis.visible = !1, this.type === GLASS_BLOCK_TYPE ? createGlassRectExplode(this.vis.x, this.vis.y, this.scale, this.vis.rotation) : createPartExplode(this.vis.x, this.vis.y, 3, PART_GLASS_TYPE, null, 3), playSound("glassBrakeSound"))
- };
- b.activateBtn = function () {
- if (!this.isActivated) {
- this.isActivated = !0;
- this.vis.currentAnimationFrame =
- 1;
- for (var a, b = 0; b < allChars.length; b++) a = allChars[b], a.isMechanic && !a.isActivated && a.labelId === this.labelId && a.activateMechanic();
- playSound("clickSound")
- }
- };
- b.deActivateBtn = function () {
- if (this.isActivated) {
- this.isActivated = !1;
- this.vis.currentAnimationFrame = 0;
- for (var a, b = 0; b < allChars.length; b++) a = allChars[b], a.isMechanic && a.isActivated && a.labelId === this.labelId && a.deActivateMechanic();
- playSound("clickSound")
- }
- };
- b.activateMechanic = function () {
- this.isActivated = !0
- };
- b.deActivateMechanic = function () {
- this.isActivated = !1
- };
- b.toggleFan = function () {
- if (this.isActivated = !this.isActivated) this.vis.gotoAndPlay("FAN_TYPE_ON"), awakeAllBodies(), playWindSound();
- else {
- this.vis.gotoAndStop("FAN_TYPE");
- for (var a = 0, b = allFans.length - 1; 0 <= b; --b) allFans[b].isActivated && a++;
- 1 > a && stopWindSound()
- }
- };
- b.removeFromField = function () {
- this.disposePhysBody();
- this.isByPhysPosUpdate = !1;
- currentRemovablesNum--;
- var a = this;
- createjs.Tween.get(this.vis)
- .to({
- alpha: 0,
- scaleX: 0,
- scaleY: 0
- }, 250)
- .call(function () {
- a.isNeedDispose = !0
- });
- playRemoveObjectSound()
- };
- b.disposePhysBody = function () {
- this.physBody && toDisposePhysicsBodies.push(this.physBody);
- this.physBody = null
- };
- c.CharBase = a
- })(window);
- var allChars = [],
- allHeroes = [],
- disposedChars = [],
- allBombs = [],
- allMonsters = [],
- allActivators = [],
- allTeleports = [],
- allFans = [],
- blockContainer, currentLevel = 0,
- isLevelCompleted = !1,
- isLevelFailed = !1,
- isInflateReason = !1,
- currentChar, totalFriends = 0,
- totalBonuses = 0,
- collectedBonuses = 0,
- totalScore = 0,
- currentLevelScore = 0,
- scoreToAdd = 0;
- function initLevelManager() {
- container.addChild(blockContainer);
- initPhysics();
- stage.addEventListener("stagemousedown", onCharContainerMouseDown);
- stage.addEventListener("stagemouseup", onCharContainerMouseUp)
- }
- function createChar(c, a, b, g, f, d, e) {
- c = geCharFromPool(c, blockContainer, g, f, e);
- c.setPosition(a, b, d);
- c.initPhysics();
- isArrayContains(allChars, c) || allChars.push(c);
- return c
- }
- var levelRestartsCounter = 0,
- levelsWithoutRestartsCounter = 0,
- diamondsCounter = 0;
- function loadLevel(c) {
- currentLevel != c && (levelRestartsCounter = 0, MORE_EASY_MULT = 1);
- currentLevel = c;
- currentLevel >= LEVELS_NUM && (currentLevel %= LEVELS_NUM);
- showBgByLevelNum(currentLevel);
- setCurrentLevelLabel(currentLevel);
- loadLevelByCode(allLevels[currentLevel]);
- isLevelRestarted = isGamePaused = !1;
- isNeedCacheSizeUpdate = !0;
- playSound("levelStart")
- }
- var totalEnemies = 0;
- function loadLevelByCode(c) {
- isGamePaused = !0;
- disposeLevel();
- addInstructions();
- if (c) {
- totalEnemies = 0;
- resetSoundOnNewLevel();
- for (var a = 0; a < c.length; a++) {
- var b = c[a];
- isBonus(b[0]) ? createBonus(b[0], b[1], b[2], b[3], b[4], b[5], b[6]) : createChar(b[0], b[1], b[2], b[3], b[4], b[5], b[6])
- }
- }
- }
- function isBonus(c) {
- return -1 < c.indexOf("BONUS")
- }
- var isLevelRestarted = !1;
- function restartLevel() {
- isLevelRestarted = !0;
- levelRestartsCounter += 1;
- levelsWithoutRestartsCounter = 0;
- loadLevel(currentLevel)
- }
- function loadNextLevel() {
- loadLevel(currentLevel + 1)
- }
- var levelStartTimer = 0;
- function disposeLevel() {
- disposeInstructions();
- isLevelFailed = isLevelCompleted = isInflateReason = !1;
- levelStartTimer = 0;
- currentChar = null;
- currentRemovablesNum = collectedBonuses = totalBonuses = currentLevelScore = scoreToAdd = 0;
- var c = allChars.length,
- a;
- for (a = 0; a < c; a++) allChars.pop()
- .dispose();
- toDisposeChars = [];
- clickedChars = [];
- disposeBonuses();
- allBombs = [];
- allMonsters = [];
- allActivators = [];
- allTeleports = [];
- for (allFans = []; 0 < toDisposePhysicsBodies.length;) c = toDisposePhysicsBodies.pop(), destroyBody(c);
- space.step(0.01);
- window.gc &&
- window.gc()
- }
- function disposeLevelPhysics() {
- var c = allChars.length,
- a;
- for (a = 0; a < c; a++) allChars[a].disposePhysBody();
- for (; 0 < toDisposePhysicsBodies.length;) c = toDisposePhysicsBodies.pop(), destroyBody(c)
- }
- function addScore(c) {
- currentLevelScore += c
- }
- function addToDisposed(c) {
- isArrayContains(disposedChars, c) || disposedChars.push(c)
- }
- function geCharFromPool(c, a, b, g, f) {
- if (0 < disposedChars.length) {
- var d = disposedChars.pop();
- d.reset(c, a, b, g, f);
- return d
- }
- return new CharBase(c, a, b, g, f)
- }
- var BIG_DISTANCE = 1E8;
- function onCharContainerMouseDown(c) {
- splashContainer && splashContainer.parent && sponsorClick(c);
- if (!(isGamePaused || isLevelCompleted || isLevelFailed)) {
- var a = (c.stageX - container.x) / scaleFactor;
- c = (c.stageY - container.y) / scaleFactor;
- for (var b, g = 0, f = g = 0, d = 0, d = 0; d < allBombs.length; d++)
- if (b = allBombs[d], !b.isExploded && (g = b.vis.x - a, f = b.vis.y - c, g = g * g + f * f, 484 > g)) {
- addToArray(clickedChars, b);
- return
- }
- for (d = allFans.length - 1; 0 <= d; --d)
- if (b = allFans[d], g = b.vis.x - a, f = b.vis.y - c, g = g * g + f * f, 784 > g) {
- addToArray(clickedChars, b);
- return
- }(a =
- getBodyAtMouse(a / PHYS_SCALE, c / PHYS_SCALE)) && (c = a.userdata) && c.isRemovable && addToArray(clickedChars, a.userdata)
- }
- }
- function onCharContainerMouseUp(c) {}
- var lastopenedlvl = 0,
- levelstates = [],
- LEVELS_NUM = 20,
- ZERO_STAR = 0,
- ONE_STAR = 1,
- TWO_STAR = 2,
- THREE_STAR = 3,
- ACHIEVS_NUM = 6,
- NOT_ACHIEVED = 0,
- ACHIEVED = 1,
- allachievs = [],
- GREAT_START_ACHIEV = 0,
- SUPER_COLLECTOR_ACHIEV = 1,
- DESTROYER_ACHIEV = 2,
- AMAZING_GAME_ACHIEV = 3,
- SOCCER_MASTER_ACHIEV = 4,
- MEGA_STAR_ACHIEV = 5,
- isStorageSupported = !1;
- function loadSaves() {
- lastopenedlvl = 0;
- if (isStorageSupported = isSupportshtml5storage())
- if (localStorage[STORAGE_PREFIX + "lastopenedlvl"]) {
- lastopenedlvl = parseInt(localStorage[STORAGE_PREFIX + "lastopenedlvl"]);
- for (a = 0; a < LEVELS_NUM; a++) levelstates.push(parseInt(localStorage[STORAGE_PREFIX + "levelstate" + a]));
- for (a = 0; a < ACHIEVS_NUM; a++) {
- var c = localStorage[STORAGE_PREFIX + "achiev" + a];
- c ? allachievs.push(parseInt(c)) : allachievs.push(NOT_ACHIEVED)
- }
- isMute = "1" == localStorage[STORAGE_PREFIX + "ismute"];
- totalFriends = localStorage[STORAGE_PREFIX +
- "totalfriends"] ? parseInt(localStorage[STORAGE_PREFIX + "totalFriends"]) : 0;
- totalScore = localStorage[STORAGE_PREFIX + "totalScore"] ? parseInt(localStorage[STORAGE_PREFIX + "totalScore"]) : 0;
- diamondsCounter = localStorage[STORAGE_PREFIX + "diamondsCounter"] ? parseInt(localStorage[STORAGE_PREFIX + "diamondsCounter"]) : 0
- } else {
- trace("saves not found!");
- for (a = 0; a < LEVELS_NUM; a++) levelstates.push(ZERO_STAR);
- for (a = 0; a < ACHIEVS_NUM; a++) allachievs.push(NOT_ACHIEVED);
- updateSaves()
- } else {
- trace("storage not supported");
- for (var a =
- 0; a < LEVELS_NUM; a++) levelstates.push(ZERO_STAR);
- for (a = 0; a < ACHIEVS_NUM; a++) allachievs.push(NOT_ACHIEVED)
- }
- }
- function getStarsForLevel(c) {
- return levelstates[c]
- }
- function saveGame(c) {
- lastopenedlvl <= currentLevel && (lastopenedlvl = currentLevel + 1);
- levelstates[currentLevel] < c && (levelstates[currentLevel] = c);
- updateSaves()
- }
- function updateSaves() {
- if (isStorageSupported) {
- localStorage[STORAGE_PREFIX + "lastopenedlvl"] = lastopenedlvl;
- for (var c = 0; c < LEVELS_NUM; c++) localStorage[STORAGE_PREFIX + "levelstate" + c] = levelstates[c];
- for (c = 0; c < ACHIEVS_NUM; c++) localStorage[STORAGE_PREFIX + "achiev" + c] = allachievs[c];
- saveMuteState();
- localStorage[STORAGE_PREFIX + "totalfriends"] = "" + totalFriends;
- localStorage[STORAGE_PREFIX + "totalScore"] = "" + totalScore;
- localStorage[STORAGE_PREFIX + "diamondsCounter"] = "" + diamondsCounter
- }
- }
- function saveMuteState() {
- isStorageSupported && (localStorage[STORAGE_PREFIX + "ismute"] = isMute ? "1" : "0")
- }
- function isSupportshtml5storage() {
- try {
- var c = "localStorage" in window && null !== window.localStorage;
- c && (localStorage.setItem("storage", ""), localStorage.removeItem("storage"));
- return c
- } catch (a) {
- return !1
- }
- }
- var allInstructions = [];
- function createInstruction(c, a, b, g) {
- c = createPart(PART_INSTRUCTION_TYPE, c, a, 1, g ? blockContainer : allBgContainer);
- c.setFrame(b);
- allInstructions.push(c);
- return c
- }
- function addInstructions() {
- isLevelRestarted || updateBgCache()
- }
- function disposeInstructions() {
- for (; 0 < allInstructions.length;) allInstructions.pop()
- .dispose()
- }
- function getCollectedStarsNum() {
- for (var c = 0, a = 0; a < LEVELS_NUM; a++) c += levelstates[a];
- return c
- }
- function createExplosion(c) {
- for (var a, b = allChars.length - 1; 0 <= b; --b) a = allChars[b], a !== c && a.physBody && (a.physBody.isStatic() || a.isPhysStatic && a.type !== GLASS_BLOCK_TYPE || -1 < a.teleportationStatus || a.isDied || a.isMovable || a.isAim || a.isLand || CreateExplode(c, a))
- }
- function CreateExplode(c, a) {
- var b = a.physBody,
- g = a.vis.x - c.vis.x,
- f = a.vis.y - c.vis.y,
- d = Math.sqrt(g * g + f * f);
- d > c.activDistance || (a.type === GLASS_BLOCK_TYPE ? d < 0.6 * c.activDistance && a.breakGlass() : (g /= d, f /= d, d = Math.max(0, 1 - d / c.activDistance), d = d * c.activForce * b.m, d = v(g * d, f * d), b.applyImpulse(d, v(10 * Math.random() - 5, 0)), a.isByPhysPosUpdate = !0))
- }
- var allBonuses = [],
- disposedBonuses = [],
- currentBon;
- function initBonusManager() {}
- function createBonus(c, a, b, g, f, d, e) {
- c = getBonusFromPool(c, blockContainer, g, f, e);
- c.setPos(a, b, d);
- addToArray(allBonuses, c)
- }
- function disposeBonuses() {
- var c = allBonuses.length,
- a;
- for (a = 0; a < c; a++) allBonuses.pop()
- .dispose()
- }
- function addToDisposedBonuses(c) {
- isArrayContains(disposedBonuses, c) || disposedBonuses.push(c)
- }
- function getBonusFromPool(c, a, b, g, f) {
- if (0 < disposedBonuses.length) {
- var d = disposedBonuses.pop();
- d.reset(c, a, b, g, f);
- return d
- }
- return new BonusBase(c, a, b, g, f)
- }
- var toDisposeBonuses = [];
- function updateBonusManager() {
- for (var c = 0; c < allBonuses.length; c++) allBonuses[c].tick(), allBonuses[c].isCollected && addToArray(toDisposeBonuses, allBonuses[c]);
- for (; 0 < toDisposeBonuses.length;) toDisposeBonuses.pop()
- .dispose()
- }
- (function (c) {
- function a(a, b, c, e, h) {
- var k = new createjs.Sprite(zoeSS);
- k.mouseEnabled = !1;
- k.baseBlock = this;
- this.vis = k;
- this.reset(a, b, c, e, h)
- }
- var b = a.prototype;
- b.reset = function (a, b, d, e, h) {
- this.typeId = a;
- this.type = c[a];
- createjs.Tween.removeTweens(this.vis);
- this.tweenMaxSteps = 0;
- this.isNeedCollect = !1;
- this.additParams = h;
- this.parent = b;
- this.vis.isOnTop = !1;
- this.vis.isOnBottom = !0;
- this.vis.alpha = 1;
- this.isCollected = this.isGhost = !1;
- this.animMargin = 30 * Math.random();
- this.scaleX = d;
- this.scaleY = e;
- this.moveTarget = null;
- this.distanceSq =
- this.speed = this.dy = this.dx = 0;
- this.hero = null;
- this.dir = 1;
- this.distanceStartX = this.distanceEndX = 0;
- this.sensorRadiusSq = 3600;
- this.collectRadiusSq = 100;
- this.setVisionByType();
- this.updateVisionScale();
- b.addChild(this.vis);
- this.isGhost || totalBonuses++
- };
- b.setPos = function (a, b, c) {
- this.vis.x = a;
- this.vis.y = b;
- this.isGhost && 0 === this.distanceStartX && (this.distanceEndX = 140 * this.scaleX - 52 * this.scaleY, this.distanceStartX = a - this.distanceEndX / 2, this.distanceEndX = a + this.distanceEndX / 2);
- c && (this.vis.rotation = c)
- };
- b.updateVisionScale =
- function () {
- this.vis.scaleX = this.scaleX;
- this.vis.scaleY = this.scaleY;
- this.isGhost && (this.vis.scaleX = this.scaleY)
- };
- b.getAdditParams = function (a) {
- return this.additParams[0].split("_")[a]
- };
- b.setVisionByType = function () {
- this.vis.gotoAndStop(this.typeId);
- this.type === BONUS_DIAMOND_TYPE && (this.vis.play(), this.vis._animation.speed = 1.5);
- this.vis.paused || (this.vis.currentAnimationFrame = Math.floor(20 * Math.random()));
- this.type === BONUS_GHOST_TYPE && (this.isGhost = !0, this.vis.play(), this.speed = parseInt(this.getAdditParams(0)) /
- 10, this.vis._animation.speed = 0.7, this.sensorRadiusSq = 625)
- };
- b.tick = function () {
- if (!this.isCollected && !isGamePaused)
- if (this.isGhost) this.updateGhost();
- else if (this.vis.scaleX = this.scaleX + Math.cos((counter + this.animMargin) / 10) / 12, this.vis.scaleY = this.vis.scaleX, this.moveTarget) this.speed += 0.2, this.dx = this.moveTarget.vis.x - this.vis.x, this.dy = this.moveTarget.vis.y - this.vis.y, this.distanceSq = this.dx * this.dx + this.dy * this.dy, this.vis.x += this.dx / 3 * this.speed, this.vis.y += this.dy / 3 * this.speed, this.distanceSq <
- this.collectRadiusSq && (this.isCollected = !0, createPrerenderedPart(this.moveTarget.vis.x, this.moveTarget.vis.y, 1, "parteffectv1", 0.9, this.moveTarget.vis), addScore(this.getScoreByType()), this.checkBonusAchievByType(), this.moveTarget = null, collectedBonuses++, playBonusPickSound());
- else
- for (var a = 0; a < allHeroesLen; a++) this.hero = allHeroes[a], this.dx = this.hero.vis.x - this.vis.x, this.dy = this.hero.vis.y - this.vis.y, this.distanceSq = this.dx * this.dx + this.dy * this.dy, this.distanceSq < this.sensorRadiusSq && (this.moveTarget =
- this.hero)
- };
- b.updateGhost = function () {
- this.vis.x += this.speed * this.dir * dtScale;
- this.vis.x > this.distanceEndX && (this.dir = -1);
- this.vis.x < this.distanceStartX && (this.dir = 1);
- for (var a = 0; a < allHeroesLen; a++) this.hero = allHeroes[a], this.dx = this.hero.vis.x - this.vis.x, this.dy = this.hero.vis.y - this.vis.y, this.distanceSq = this.dx * this.dx + this.dy * this.dy, this.distanceSq < this.sensorRadiusSq && this.hero.die()
- };
- b.checkBonusAchievByType = function () {
- for (var a = 0; a < allBonuses.length; a++);
- };
- b.getScoreByType = function () {
- switch (this.type) {
- case BONUS_STAR_TYPE:
- return 50;
- case BONUS_DIAMOND_TYPE:
- return 150;
- case BONUS_MONEY_TYPE:
- return 100;
- default:
- return 50
- }
- };
- b.dispose = function () {
- removeFromArray(allBonuses, this);
- addToDisposedBonuses(this);
- this.vis.removeAllEventListeners();
- this.vis.stop();
- this.parent.removeChild(this.vis)
- };
- b.startCollectAnim = function (a) {};
- c.BonusBase = a
- })(window);
- var isAudioSupported = !1,
- isMute = !1;
- function initSoundManager() {
- isDesktop() || createjs.Sound.registerPlugins([createjs.WebAudioPlugin]);
- (isAudioSupported = isSamsungDefaultBrowser() ? !1 : createjs.Sound.initializeDefaultPlugins()) && manifest.push({
- src: "click.ogg|click.mp3",
- id: "clickSound",
- data: 1
- }, {
- src: "win.ogg|win.mp3",
- id: "winSound",
- data: 1
- }, {
- src: "sm_main_music.ogg|sm_main_music.mp3",
- id: "bgMusic",
- data: 1
- }, {
- src: "fail.ogg|fail.mp3",
- id: "restartSound",
- data: 1
- }, {
- src: "explosion.ogg|explosion.mp3",
- id: "explodeSound",
- data: 1
- }, {
- src: "elk_achievement_voice2.ogg|elk_achievement_voice2.mp3",
- id: "achievSound0",
- data: 1
- }, {
- src: "elk_achievement_voice1.ogg|elk_achievement_voice1.mp3",
- id: "achievSound1",
- data: 1
- }, {
- src: "star1.ogg|star1.mp3",
- id: "star1",
- data: 1
- }, {
- src: "star2.ogg|star2.mp3",
- id: "star2",
- data: 1
- }, {
- src: "star3.ogg|star3.mp3",
- id: "star3",
- data: 1
- }, {
- src: "whistles_got1.ogg|whistles_got1.mp3",
- id: "bonus0",
- data: 1
- }, {
- src: "whistles_got2.ogg|whistles_got2.mp3",
- id: "bonus1",
- data: 1
- }, {
- src: "whistles_got3.ogg|whistles_got3.mp3",
- id: "bonus2",
- data: 1
- }, {
- src: "start_game.ogg|start_game.mp3",
- id: "levelStart",
- data: 1
- }, {
- src: "remove_object1.ogg|remove_object1.mp3",
- id: "remove_object0",
- data: 1
- }, {
- src: "remove_object2.ogg|remove_object2.mp3",
- id: "remove_object1",
- data: 1
- }, {
- src: "remove_object3.ogg|remove_object3.mp3",
- id: "remove_object2",
- data: 1
- }, {
- src: "teleport.ogg|teleport.mp3",
- id: "portalAppearSound",
- data: 2
- }, {
- src: "glass.ogg|glass.mp3",
- id: "glassBrakeSound",
- data: 1
- }, {
- src: "wind_release.ogg|wind_release.mp3",
- id: "windRelease",
- data: 1
- })
- }
- function isSamsungDefaultBrowser() {
- var c = navigator.userAgent;
- return -1 < c.toLowerCase()
- .indexOf("samsung") && -1 < c.indexOf("Android ")
- }
- function playSound(c, a) {
- if (!isMute && isAudioSupported) return createjs.Sound.play(c, {
- interrupt: createjs.Sound.INTERRUPT_EARLY,
- loop: a ? -1 : 0
- })
- }
- function toggleMute() {
- (isMute = !isMute) ? (stopBgMusic(), stopWindSound()) : playBgMusic();
- saveMuteState()
- }
- var scoresSound;
- function playScoresSound() {
- !isMute && isAudioSupported && (scoresSound ? scoresSound.play() : scoresSound = playSound("countScoreSound", !1))
- }
- function stopScoresSound() {
- isAudioSupported && scoresSound && (scoresSound.stop(), scoresSound = null)
- }
- var windSound;
- function playWindSound() {
- !isMute && isAudioSupported && (windSound = playSound("windRelease", !1))
- }
- function stopWindSound() {
- isAudioSupported && windSound && (windSound.stop(), windSound = null)
- }
- function playRemoveObjectSound() {
- playSound("remove_object" + Math.floor(3 * Math.random()))
- }
- function resetSoundOnNewLevel() {
- isAudioSupported && (bonusSoundNum = 0)
- }
- var bonusSoundNum = 0;
- function playBonusPickSound() {
- playSound("bonus" + bonusSoundNum);
- bonusSoundNum++;
- 2 < bonusSoundNum && (bonusSoundNum = 0)
- }
- var achievSoundNum = 0;
- function playAchievSound() {
- playSound("achievSound" + achievSoundNum);
- achievSoundNum++;
- 1 < achievSoundNum && (achievSoundNum = 0)
- }
- function startBgMusic() {
- bgMusic || playBgMusic()
- }
- var bgMusic;
- function playBgMusic() {
- !isMute && isAudioSupported && (bgMusic ? bgMusic.resume() : bgMusic = playSound("bgMusic", !0))
- }
- function stopBgMusic() {
- isAudioSupported && bgMusic && bgMusic.pause()
- }
- var pauseBtnV, playMenuBtn, creditsBtn, logoImg, levelSelectContainer, interfaceRestartBtn, isGamePaused, levelLabel, menuEase;
- function initInterface() {
- pauseBtnV = createButton(18, 18, 0.8, "pausebtn", onPausePress, null, onPauseUp);
- interfaceRestartBtn = createButton(18, 18, 0.6, "restartbtn", onPressStandartHandler, null, onInterfaceRestartUp);
- levelLabel = new createjs.BitmapText("0", zoeSS);
- levelLabel.scaleX = levelLabel.scaleY = 0.25;
- levelLabel.mouseEnabled = !1;
- levelLabel.y = 253;
- levelLabel.score = 0;
- levelLabel.spaceWidth = 10;
- levelLabel.postfix = "ll";
- menuEase = createjs.Ease.getElasticOut(1, 0.35);
- createMainMenu();
- createLevelSelectMenu();
- createLevelCompleteWin();
- createPauseWin();
- createAchievWin();
- createAchievGalleryMenu();
- createCreditsWin();
- creategameCompleteWin();
- createBlinkWin();
- isGamePaused = !0;
- isSkipMenus ? showGameInterface() : isLevelSelectShow ? showLevelsMenu() : showMainMenu(!1)
- }
- var blinkWin;
- function createBlinkWin() {
- blinkWin = createButton(-40, -60, 6.5, "tint2");
- blinkWin.scaleX = 4.5
- }
- function startBlink(c, a) {
- addToParent(blinkWin, container);
- blinkWin.alpha = 1;
- blinkWin.gotoAndStop(a);
- createjs.Tween.get(blinkWin, {
- override: !0
- })
- .to({
- alpha: 0
- }, c)
- .call(removeChildOnTweenComplete)
- }
- function showFPSMeter() {
- isNeedFpsMeter && addToParent(fpsText, container);
- isNeedHelperLabel && addToParent(helperLabel, container)
- }
- function showGameInterface() {
- addToParent(pauseBtnV, container);
- addToParent(interfaceRestartBtn, container);
- addToParent(levelLabel, container);
- showFPSMeter()
- }
- function hideGameInterface() {
- pauseBtnV.parent && container.removeChild(pauseBtnV);
- removeFromParent(interfaceRestartBtn);
- removeFromParent(levelLabel)
- }
- function setCurrentLevelLabel(c) {
- levelLabel.text = "l " + (c + 1)
- }
- function onPausePress(c) {
- isGamePaused || isLevelFailed || isLevelCompleted || onHoverScale(c.target)
- }
- function onPauseUp(c) {
- onOutScale(c.target);
- isGamePaused || isLevelFailed || isLevelCompleted || levelPauseContainer.parent || isCursorOutMoved(c) || (playSound("clickSound"), showPauseWin())
- }
- var menuContainer, mainMenuMuteBtn, mainMenuMoreGames, mainMenuAchievBtn;
- function createMainMenu() {
- menuContainer = new createjs.Container;
- playMenuBtn = createButton(ow / 2, 220, 0.7, "playbtnup", onPlayPress, menuContainer, onPlayUp);
- creditsBtn = createButton(300, 200, 0.8, "btnbaseup", onCreditsPress, menuContainer, onCreditsUp);
- logoImg = createButton(ow / 2 + 5, 175, 1, "logov", null, menuContainer);
- mainMenuAchievBtn = createButton(37, 170, 0.8, "achievbtn", onAchievGalleryPress, menuContainer, onAchievGalleryUp);
- mainMenuMuteBtn = createButton(382, 17, 0.65, "musiconbtn", onMainMenuMutePress, menuContainer, onMainMenuMuteUp);
- mainMenuMoreGames = createButton(100, 190, 0.7, "moregames2v", sponsorClick, menuContainer, null);
- isAudioSupported || (mainMenuMuteBtn.visible = !1);
- createMainMenuTweens()
- }
- var MUTED_FRAME = "musicoffbtn",
- UNMUTED_FRAME = "musiconbtn";
- function onMainMenuMutePress(c) {
- onHoverScale(c.target)
- }
- function onMainMenuMuteUp(c) {
- onOutScale(c.target);
- isCursorOutMoved(c) || (toggleMute(), updateMusicIconFrame(c.target), playSound("clickSound"))
- }
- function updateMusicIconFrame(c) {
- c.gotoAndStop(isMute ? MUTED_FRAME : UNMUTED_FRAME)
- }
- function showMainMenu(c) {
- container.addChild(menuContainer);
- updateMusicIconFrame(mainMenuMuteBtn);
- showBgByLevelNum(0, 2);
- showFPSMeter();
- showTopLogo(0.8);
- c && (startBlink(700, "tint2"), isNeedCacheSizeUpdate = !0)
- }
- function showMainMenuTweenComplete(c) {}
- function hideMainMenu() {
- removeFromParent(menuContainer)
- }
- function hideMainMenuTweenComplete(c) {
- c = c.target;
- c.alpha = 1;
- c.parent && container.removeChild(c)
- }
- function createBigWinBg(c, a, b, g) {
- c = createButton(c, a, isLowQuality ? 2 : 1, isLowQuality ? "smallwinv" : "bgwinv", null, g);
- c.rotation = -90;
- c.scaleX = isLowQuality ? 2 * b : b
- }
- function createMainMenuTweens() {
- var c = createjs.Ease.bounceOut;
- createjs.Tween.removeTweens(playMenuBtn);
- playMenuBtn.scaleX = playMenuBtn.scaleY = 0.75;
- createjs.Tween.get(playMenuBtn, {
- override: !0,
- loop: !0
- })
- .to({
- scaleX: 0.95,
- scaleY: 0.95
- }, 3E3, c)
- .wait(1E3)
- .to({
- scaleX: 0.75,
- scaleY: 0.75
- }, 3E3, c)
- }
- function disposeMainMenuTweens() {
- createjs.Tween.removeTweens(playMenuBtn)
- }
- function onPlayPress(c) {
- onHoverScale(c.target)
- }
- function onPlayUp(c) {
- onOutScale(c.target);
- isCursorOutMoved(c) || (playSound("clickSound"), hideMainMenu(), showLevelsMenu(), startBgMusic())
- }
- function onAchievGalleryPress(c) {
- onHoverScale(c.target)
- }
- function onAchievGalleryUp(c) {
- onOutScale(c.target);
- isCursorOutMoved(c) || (playSound("clickSound"), hideMainMenu(), showAchievGallery())
- }
- function onCreditsPress(c) {
- c.target.scaleX = c.target.scaleY = 0.9;
- trace("play credits!")
- }
- function onCreditsUp(c) {
- c.target.scaleX = c.target.scaleY = 0.8;
- isCursorOutMoved(c) || (playSound("clickSound"), hideMainMenu(), showCreditsWin())
- }
- function createButton(c, a, b, g, f, d, e) {
- var h = new createjs.Sprite(interfaceSS);
- h.snapToPixel = !0;
- h.x = c;
- h.y = a;
- h.scaleX = h.scaleY = b;
- h.gotoAndStop(g);
- h.defaultScale = b;
- e && h.addEventListener("pressup", e, !1);
- f ? (h.addEventListener("mousedown", f, !1), h.cursor = "pointer") : h.mouseEnabled = !1;
- (f || e) && (c = interfaceSS.getAnimation(g)) && c.frames && 0 < c.frames.length && (c = interfaceSS.getFrameBounds(c.frames[0]), h.setBoundingBox(c.x * b, c.y * b, c.width * b, c.height * b));
- d && d.addChild(h);
- return h
- }
- var selectMenuBackBtn, selectMenuNextBtn, selectMenuPreviousBtn, allLevelBtns = [],
- levelsScreen1, levelsScreen2;
- function createLevelSelectMenu() {
- var c = levelSelectContainer = new createjs.Container;
- levelSelectContainer.name = "levelselcont";
- createBigWinBg(5, 438, 0.95, c);
- levelsScreen1 = new createjs.Container;
- levelsScreen1.name = "levelsScreen1";
- levelsScreen2 = new createjs.Container;
- createButton(156, 73, 1, "levelselecttitle", null, levelSelectContainer);
- selectMenuBackBtn = createButton(28, 411, 0.8, "backbtn", onBackToMenuPress, levelsScreen1, onBackToMenuUp);
- createLevelsButtons();
- levelSelectContainer.addChild(levelsScreen1)
- }
- function cacheWin(c) {
- c.cache(-10, -10, ow + 20, oh + 20)
- }
- function uncacheWin(c) {
- c.uncache()
- }
- function createLevelsButtons() {
- for (var c = 0; 20 > c; c++) {
- var a = createButton(62 + 65 * (c % 4), 129 + 60 * Math.floor(c / 4), 0.72, "lvlLabelStar0", onLevelBtnPress, levelsScreen1, onLevelBtnUp);
- a.levelNum = c;
- allLevelBtns.push(a);
- var b = createButton(a.x - 24, a.y - 26, 0.7, "lvlnum" + (c + 1), null, levelsScreen1);
- a.txtNum = b
- }
- }
- function updateLevelsButtons() {
- for (var c = 0; 20 > c; c++) {
- var a = c <= lastopenedlvl;
- isOpenAllLevels && (a = c < openedLevels);
- var b;
- b = a ? "lvlLabelStar" + getStarsForLevel(c) : "levelbuttonlocked";
- var g = allLevelBtns[c];
- g.gotoAndStop(b);
- (g.isOpened = a) ? g.txtNum.parent || g.parent.addChild(g.txtNum) : g.txtNum.parent && g.parent.removeChild(g.txtNum)
- }
- }
- function onLevelBtnPress(c) {
- c = c.target;
- onHoverScale(c);
- trace("level " + c.levelNum + " load");
- updateCacheByBtnNum(c.levelNum)
- }
- function onLevelBtnUp(c) {
- var a = c.target;
- onOutScale(a);
- isCursorOutMoved(c) ? updateCacheByBtnNum(a.levelNum) : a.isOpened ? (levelsWithoutRestartsCounter = levelRestartsCounter = 0, showGameInterface(), loadLevel(a.levelNum), startBlink(400, "tint2"), showGameField(), hideLevelsMenu()) : (updateCacheByBtnNum(a.levelNum), playSound("clickSound"))
- }
- function updateCacheByBtnNum(c) {}
- function onBackToMenuPress(c) {
- onHoverScale(c.target)
- }
- function onBackToMenuUp(c) {
- onOutScale(c.target);
- isCursorOutMoved(c) || (hideLevelsMenu(), showMainMenu(!0), playSound("clickSound"))
- }
- function showLevelsMenu() {
- container.addChild(levelSelectContainer);
- updateLevelsButtons();
- levelsScreen2.parent && levelSelectContainer.removeChild(levelsScreen2);
- levelsScreen1.parent || levelSelectContainer.addChild(levelsScreen1);
- levelsScreen1.x = 0;
- levelsScreen1.alpha = 1;
- showBgByLevelNum(0, 1, 1.2);
- startBlink(700, "tint2");
- isNeedCacheSizeUpdate = !0;
- showTopLogo(0.8)
- }
- function hideLevelsMenu() {
- createjs.Tween.removeTweens(levelSelectContainer);
- removeFromParent(levelSelectContainer)
- }
- function showGameField() {
- createjs.Tween.removeTweens(blockContainer);
- blockContainer.parent || container.addChild(blockContainer);
- blockContainer.alpha = 0;
- blockContainer.visible = !0;
- createjs.Tween.get(blockContainer, {
- override: !0
- })
- .to({
- alpha: 1
- }, 400)
- }
- function hideGameField(c, a) {
- isGamePaused = !0;
- createjs.Tween.removeTweens(blockContainer);
- var b = createjs.Tween.get(blockContainer)
- .to({
- alpha: 0,
- visible: !1
- }, a ? a : 200)
- .call(removeFromParent);
- c && b.call(disposeLevelPhysics)
- }
- function showRestartWin() {
- isLevelFailed && (levelPauseContainer.parent || showPauseWin(!0))
- }
- var levelCompleteContainer, completeWinNextBtn, star1, star2, star3, completeLevelLabel, completeTotalScore;
- function createLevelCompleteWin() {
- var c = levelCompleteContainer = new createjs.Container;
- createBigWinBg(5, 400, 0.83, c);
- var a = createButton(ow / 2, 220, 0.9, "lvlcompletebgnew", null, c);
- completeWinNextBtn = createButton(270, 390, 0.85, "nextlevelwin", onPressStandartHandler, c, onNextLevelUp);
- createButton(70, 330, 1, "completeelk", null, c, null);
- createButton(50, 390, 0.9, "restartbtn", onPressStandartHandler, c, onCompleteRestartUp);
- createButton(210, 310, 0.8, "levelreadylabel", null, c);
- star1 = createButton(a.x - 82, a.y - 20, 1, "completestar",
- null, null, null);
- star1.rotation = -15;
- star2 = createButton(a.x + 1, a.y - 27, 1, "completestar", null, null, null);
- star3 = createButton(a.x + 86, a.y - 16, 1, "completestar", null, null, null);
- star3.rotation = 12;
- completeLevelLabel = new createjs.BitmapText("0", zoeSS);
- completeLevelLabel.scaleX = completeLevelLabel.scaleY = 0.65;
- completeLevelLabel.mouseEnabled = !1;
- completeLevelLabel.y = 297;
- completeLevelLabel.x = 240;
- completeLevelLabel.score = 0;
- addToParent(completeLevelLabel, c);
- createButton(160, 390, 0.85, "moregames2v", sponsorClick, c, null)
- }
- function onCompleteQuitUp(c) {
- onOutScale(c.target);
- isCursorOutMoved(c) || (hideGameField(!1), disposeLevel(), hideLevelCompleteWin(), showMainMenu(!0), playSound("clickSound"), stopScoresSound())
- }
- function onCompleteRestartUp(c) {
- onOutScale(c.target);
- isCursorOutMoved(c) || (playSound("clickSound"), restartLevel(), showGameField(), hideLevelCompleteWin(), stopScoresSound())
- }
- function onPressStandartHandler(c) {
- onHoverScale(c.target)
- }
- function onNextLevelUp(c) {
- onOutScale(c.target);
- isCursorOutMoved(c) || (playSound("clickSound"), hideLevelCompleteWin(), handleNextLevelClick(), stopScoresSound())
- }
- function handleNextLevelClick() {
- var c = getNewAchievedId(); - 1 < c ? showAchievWin(c) : currentLevel >= LEVELS_NUM - 1 ? (hideGameInterface(), disposeLevel(), showMainMenu(!0)) : (showGameInterface(), loadNextLevel(), showGameField())
- }
- var currentLevelStarsNum = 0;
- function showLevelCompleteWin() {
- isLevelCompleted || isLevelFailed || (isLevelCompleted = !0, hideGameInterface(), createjs.Tween.removeTweens(levelCompleteContainer), removeFromParent(star1), removeFromParent(star2), removeFromParent(star3), container.addChild(levelCompleteContainer), addToParent(particleContainer, container), levelCompleteContainer.x = 400, levelCompleteContainer.alpha = 0, createjs.Tween.get(blockContainer)
- .wait(800)
- .call(hideGameField), createjs.Tween.get(levelCompleteContainer, {
- override: !0
- })
- .wait(900)
- .to({
- alpha: 1,
- x: 0
- }, 1300, menuEase)
- .call(showStars), currentLevelStarsNum = ZERO_STAR, totalBonuses <= collectedBonuses ? currentLevelStarsNum = THREE_STAR : collectedBonuses >= totalBonuses / 2 ? currentLevelStarsNum = TWO_STAR : 0 < collectedBonuses && (currentLevelStarsNum = ONE_STAR), totalScore += currentLevelScore + scoreToAdd, scoreToAdd = 0, totalFriends += totalEnemies, saveGame(currentLevelStarsNum), completeLevelLabel.text = "" + (currentLevel + 1), checkCompleteAchievs(), stopWindSound(), playSound("winSound"))
- }
- function checkCompleteAchievs() {
- 9 <= getStarsForLevel(0) + getStarsForLevel(1) + getStarsForLevel(2) && addAchiev(SUPER_COLLECTOR_ACHIEV);
- currentLevel >= LEVELS_NUM - 1 && addAchiev(SOCCER_MASTER_ACHIEV);
- 60 <= getCollectedStarsNum() && addAchiev(MEGA_STAR_ACHIEV);
- levelsWithoutRestartsCounter++;
- 5 <= levelsWithoutRestartsCounter && addAchiev(AMAZING_GAME_ACHIEV);
- 0 >= currentRemovablesNum && addAchiev(DESTROYER_ACHIEV)
- }
- var scoreTweenLength = 0;
- function showStars(c) {
- startSponsorAds();
- animateStar(star1, 20 + scoreTweenLength, 1, "star1");
- currentLevelStarsNum >= TWO_STAR && animateStar(star2, 800 + scoreTweenLength, 1, "star2");
- currentLevelStarsNum >= THREE_STAR && animateStar(star3, 1600 + scoreTweenLength, 1, "star3")
- }
- function animateStar(c, a, b, g) {
- levelCompleteContainer.addChild(c);
- c.alpha = 0;
- c.scaleX = c.scaleY = 2;
- createjs.Tween.get(c, {
- override: !0
- })
- .wait(a)
- .to({
- alpha: 1,
- scaleX: b,
- scaleY: b
- }, 700, createjs.Ease.bounceOut)
- .call(function () {});
- createjs.Tween.get({
- x: 100
- })
- .wait(a + 200)
- .call(function () {
- isLevelCompleted && (playSound(g), createPrerenderedPart(c.x, c.y, 1.2, "parteffectv2", 0.85, c, 0.8))
- })
- }
- function removeFromParent(c) {
- c.parent && c.parent.removeChild(c)
- }
- function hideLevelCompleteWin() {
- createjs.Tween.removeTweens(star1);
- createjs.Tween.removeTweens(star2);
- createjs.Tween.removeTweens(star3);
- createjs.Tween.removeTweens(levelCompleteContainer);
- createjs.Tween.get(levelCompleteContainer)
- .to({
- alpha: 0,
- x: -400
- }, 200)
- .call(removeChildOnTweenComplete);
- showGameInterface()
- }
- var levelPauseContainer, pauseContinueBtn, pauseMuteBtn, pauseTitle;
- function createPauseWin() {
- var c = levelPauseContainer = new createjs.Container;
- createBigWinBg(5, 420, 0.83, c);
- pauseTitle = createButton(ow / 2 - 2, oh / 2 - 70, 0.92, "pausetitle", null, levelPauseContainer);
- createButton(ow / 2 - 90, 345, 0.9, "quitbtn", onPauseQuitPress, levelPauseContainer, onPauseQuitUp);
- createButton(ow / 2 + 90, 345, 0.9, "restartbtn", onPauseRestartPress, levelPauseContainer, onPauseRestartUp);
- pauseMuteBtn = createButton(ow / 2, 345, 0.9, "musiconbtn", onPauseMutePress, levelPauseContainer, onPauseMuteUp);
- isAudioSupported || (pauseMuteBtn.visible = !1);
- pauseContinueBtn = createButton(160, 250, 0.8, "playbtnup", onPauseContinuePress, levelPauseContainer, onPauseContinueUp);
- createButton(160, 410, 0.9, "moregames2v", sponsorClick, levelPauseContainer, null)
- }
- function onPauseMutePress(c) {
- onHoverScale(c.target)
- }
- function onPauseMuteUp(c) {
- onOutScale(c.target);
- isCursorOutMoved(c) || (toggleMute(), updateMusicIconFrame(c.target), isMute || playSound("clickSound"))
- }
- function onPauseRestartPress(c) {
- onHoverScale(c.target)
- }
- function onPauseRestartUp(c) {
- onOutScale(c.target);
- isCursorOutMoved(c) || (playSound("clickSound"), hidePauseWin(!1, !1), showGameField(), restartLevel())
- }
- function onInterfaceRestartUp(c) {
- onOutScale(c.target);
- isCursorOutMoved(c) || (playSound("clickSound"), showGameField(), restartLevel())
- }
- function onPauseQuitPress(c) {
- onHoverScale(c.target)
- }
- function onPauseQuitUp(c) {
- onOutScale(c.target);
- isCursorOutMoved(c) || (playSound("clickSound"), isGamePaused = !0, disposeLevel(), hidePauseWin(!1, !0), updateBgCache(), hideGameField(!1, 100), showMainMenu(!0))
- }
- function onPauseContinuePress(c) {
- onHoverScale(c.target)
- }
- function onPauseContinueUp(c) {
- onOutScale(c.target);
- isCursorOutMoved(c) || (playSound("clickSound"), hidePauseWin(!1, !1))
- }
- function showPauseWin(c) {
- isGamePaused = !0;
- hideGameInterface();
- updateMusicIconFrame(pauseMuteBtn);
- container.addChild(levelPauseContainer);
- pauseContinueBtn.visible = !c;
- c ? (pauseTitle.gotoAndStop("tryagaintitle"), setSpriteScale(pauseTitle, 1), hideGameField(!0, 400), stopWindSound()) : (pauseTitle.gotoAndStop("pausetitle"), setSpriteScale(pauseTitle, 0.92));
- levelPauseContainer.x = -400;
- levelPauseContainer.y = -20;
- levelPauseContainer.alpha = 0;
- createjs.Tween.get(levelPauseContainer)
- .to({
- alpha: 1,
- x: 0
- }, 1300, menuEase)
- }
- function hidePauseWin(c, a) {
- isGamePaused = !1;
- createjs.Tween.removeTweens(levelPauseContainer);
- createjs.Tween.get(levelPauseContainer)
- .to({
- alpha: 0,
- x: 400
- }, 300)
- .call(removeChildOnTweenComplete);
- a || showGameInterface()
- }
- var achievContainer, raduga, achievDesc;
- function createAchievWin() {
- achievContainer = new createjs.Container;
- createButton(160, 84, 1, "newachievtitle", null, achievContainer);
- raduga = createButton(160, 222, 1.1, "radugav", null, achievContainer);
- createButton(160, 262, 1.1, "newachievbgv", null, achievContainer);
- achievDesc = createButton(160, 343, 0.9, "achievdesc1", null, achievContainer);
- createButton(160, 399, 1, "nextlevelwin", onAchievContinuePress, achievContainer)
- }
- function onAchievContinuePress(c) {
- hideAchievWin();
- handleNextLevelClick()
- }
- function showAchievWin(c) {
- achievContainer.parent || container.addChild(achievContainer);
- disposeLevel();
- updateBgCache();
- hideGameInterface();
- achievDesc.gotoAndStop("achievdesc" + Math.round(c));
- allachievs[c] = ACHIEVED;
- updateSaves();
- createjs.Tween.removeTweens(achievContainer);
- achievContainer.alpha = 0;
- createjs.Tween.get(achievContainer, {
- override: !0
- })
- .to({
- alpha: 1
- }, 300)
- .call(function () {
- playAchievSound()
- })
- }
- function hideAchievWin() {
- removeFromParent(achievContainer)
- }
- function getNewAchievedId() {
- return 0 < achievsReadyToShow.length ? achievsReadyToShow.pop() : -1
- }
- var achievsReadyToShow = [];
- function addAchiev(c) {
- isAlreadyAchieved(c) || addToArray(achievsReadyToShow, c)
- }
- function isAlreadyAchieved(c) {
- return allachievs[c] == ACHIEVED
- }
- var achGalleryMenuBackBtn, achGalleryContainer, achievGalleryTotalScore, allAchievsLabels = [];
- function createAchievGalleryMenu() {
- var c = achGalleryContainer = new createjs.Container;
- createBigWinBg(5, 438, 0.95, c);
- createButton(ow / 2, 76, 0.9, "achievmenutitle", null, c);
- createAchievLabels();
- achGalleryMenuBackBtn = createButton(32, 410, 0.8, "backbtn", onPressStandartHandler, c, onAchievGalleryBackUp);
- createButton(250, 390, 0.9, "achievelk", null, c)
- }
- function createAchievLabels() {
- for (var c = 0; c < ACHIEVS_NUM; c++) {
- var a = c,
- b = createButton(160, 130 + 45 * a, 0.9, "achievback", null, achGalleryContainer, null),
- a = createButton(160, 130 + 45 * a, 0.8 * 0.8, "achievclosed", null, achGalleryContainer, null);
- allAchievsLabels.push(a);
- a.bg = b
- }
- }
- function updateAchievLabels() {
- for (var c = 0; c < ACHIEVS_NUM; c++) allAchievsLabels[c].gotoAndStop(allachievs[c] == ACHIEVED ? "achievdesc" + c.toString() : "achievclosed")
- }
- function onAchievGalleryBackUp(c) {
- onOutScale(c.target);
- isCursorOutMoved(c) || (playSound("clickSound"), hideAchievGallery(), showMainMenu(!0))
- }
- function showAchievGallery() {
- container.addChild(achGalleryContainer);
- updateAchievLabels();
- achGalleryContainer.x = 0;
- achGalleryContainer.alpha = 1;
- showBgByLevelNum(0, 4, 1.2);
- startBlink(700, "tint2");
- showTopLogo(0.8)
- }
- function hideAchievGallery() {
- createjs.Tween.removeTweens(achGalleryContainer);
- createjs.Tween.get(achGalleryContainer, {
- override: !0
- })
- .to({
- alpha: 0,
- x: 400
- }, 200)
- .call(uncacheAndRemove)
- }
- var creditsContainer;
- function createCreditsWin() {
- var c = creditsContainer = new createjs.Container;
- createBigWinBg(5, 400, 0.8, c);
- createButton(33, 370, 0.9, "backbtn", onCreditsQuitPress, c, onCreditsQuitUp);
- createButton(160, 210, 0.85, "biglimetxt", null, c);
- createButton(155, 120, 0.9, "creditstitle", null, c);
- createButton(230, 337, 1, "creditselk", null, c)
- }
- function onSiteLinkPress(c) {
- window.open("http://porubov.com", "_blank")
- }
- function onCreditsLinkPress(c) {
- window.location = "mailto:seddas@gmail.com?subject=BattleFish"
- }
- function onCreditsQuitPress(c) {
- onHoverScale(c.target)
- }
- function onCreditsQuitUp(c) {
- onOutScale(c.target);
- isCursorOutMoved(c) || (playSound("clickSound"), hideCreditsWin(), showMainMenu(!0))
- }
- function showCreditsWin() {
- container.addChild(creditsContainer);
- creditsContainer.x = 0;
- creditsContainer.alpha = 1;
- showBgByLevelNum(0, 4, 1.2);
- startBlink(700, "tint2")
- }
- function hideCreditsWin() {
- removeFromParent(creditsContainer)
- }
- var gameCompleteContainer, collectedStarsTxt;
- function creategameCompleteWin() {
- gameCompleteContainer = new createjs.Container;
- createButton(ow / 2, 310, 1, "nextlevelwin", ongameCompleteQuitPress, gameCompleteContainer, ongameCompleteQuitUp);
- createButton(ow / 2, 237, 1, "levelinstruction8", null, gameCompleteContainer);
- createButton(ow / 2, 105, 1, "allcollectedstars", null, gameCompleteContainer);
- createButton(ow / 2, 30, 1, "gamecompletedTitle", null, gameCompleteContainer);
- collectedStarsTxt = new createjs.BitmapText(getCollectedStarsNum()
- .toString(), interfaceSS);
- collectedStarsTxt.letterSpacing = -7;
- collectedStarsTxt.x = 80;
- collectedStarsTxt.y = 121;
- collectedStarsTxt.mouseEnabled = !1;
- gameCompleteContainer.addChild(collectedStarsTxt);
- createButton(260, 335, 0.7, "moregamesbtn", sponsorClick, gameCompleteContainer, null)
- }
- function ongameCompleteQuitPress(c) {
- c = c.target;
- c.scaleX = c.scaleY = 1.2
- }
- function ongameCompleteQuitUp(c) {
- onOutScale(c.target);
- isCursorOutMoved(c) || (playSound("clickSound"), hidegameCompleteWin(), showMainMenu(!0))
- }
- var isGameCompleteScreenShow = !1;
- function showGameCompleteWin() {
- isGameCompleteScreenShow = !0;
- container.addChild(gameCompleteContainer);
- collectedStarsTxt.text = getCollectedStarsNum()
- .toString();
- gameCompleteContainer.x = 400;
- gameCompleteContainer.alpha = 0;
- createjs.Tween.get(gameCompleteContainer, {
- override: !0
- })
- .to({
- alpha: 1,
- x: 0
- }, 1300, createjs.Ease.elasticOut)
- }
- function hidegameCompleteWin() {
- isGameCompleteScreenShow = !1;
- updateMobileBrowserParams();
- createjs.Tween.removeTweens(gameCompleteContainer);
- createjs.Tween.get(gameCompleteContainer, {
- override: !0
- })
- .to({
- alpha: 0,
- x: 400
- }, 200)
- .call(removeChildOnTweenComplete)
- }
- function uncacheAndRemove(c) {
- c = c.target;
- c.parent && c.parent.removeChild(c)
- }
- function removeChildOnTweenComplete(c) {
- c = c.target;
- c.parent && c.parent.removeChild(c)
- }
- function isTweened(c) {
- return createjs.Tween.hasActiveTweens(c)
- }
- var hitPoint;
- function isCursorOutMoved(c) {
- if (!isDesktop()) return !1;
- hitPoint = c.target.globalToLocal(c.stageX, c.stageY);
- return !c.target.hitTest(hitPoint.x, hitPoint.y)
- }
- function updateScoreLabel(c) {}
- var rotatedDecors = [];
- function interfaceTick() {
- for (var c = 0; c < rotatedDecors.length; c++) rotatedDecors[c].rotation += 3 * dtScale;
- raduga && (raduga.rotation += dtScale, raduga.rotation %= 360)
- }
- function updateInterfacePositions() {
- pauseBtnV.x = 24 + deltaForHLeft();
- pauseBtnV.y = 416 - deltaForVTop() / 2;
- interfaceRestartBtn.x = 70 + deltaForHLeft();
- interfaceRestartBtn.y = 416 - deltaForVTop() / 2;
- creditsBtn.x = 290 - deltaForHLeft();
- creditsBtn.y = 410 - deltaForVTop() / 2;
- mainMenuMuteBtn.x = 292 - deltaForHLeft();
- mainMenuMuteBtn.y = 360 - deltaForVTop() / 2;
- mainMenuMoreGames.x = 160;
- mainMenuMoreGames.y = 420 - deltaForVTop() / 2;
- playMenuBtn.y = 330 - 0.2 * deltaForVTop();
- mainMenuAchievBtn.x = 40 + deltaForHLeft();
- mainMenuAchievBtn.y = 400 - deltaForVTop() /
- 2;
- isNeedFpsMeter && (fpsText.x = ow - 32 - deltaForHLeft(), fpsText.y = deltaForVTop() / 2);
- updateLogoPos()
- }
- var stage, exportRoot, canvas, rect, container, preload, rotationContainer, particleContainer, winWidth, winHeight, scaleFactor = 1,
- minW = 320,
- minH = 440,
- ow = minW,
- oh = minH,
- maxW = 356,
- maxH = 550,
- desctopMaxW = maxW,
- desctopMaxH = maxH,
- viewportW = minW,
- viewportH = minH,
- pixelDensity = 1;
- function initResizeManager() {
- window.addEventListener("resize", onWindowResize);
- document.addEventListener("touchstart", PreventScrollTouch);
- window.onorientationchange = orientChange;
- onGameResize();
- setTimeout(hideAdressBar, 100);
- hideAddressbar(document.getElementById("gamediv"))
- }
- var isWasPaused = null,
- topVisionLine, zoomFactor;
- function onGameResize() {
- hideAdressBar();
- var c = window.innerWidth,
- a = window.innerHeight;
- zoomFactor = 1;
- if (isLowQuality) {
- var b = Math.min(c / minW, a / minH);
- zoomFactor = Math.max(1, Math.min(2, b * b));
- c /= zoomFactor;
- a /= zoomFactor
- }
- b = "scale(" + zoomFactor + "," + zoomFactor + ")";
- canvas.style.transform = b;
- canvas.style.msTransform = b;
- canvas.style.MozTransform = b;
- canvas.style.WebkitTransform = b;
- canvas.style.OTransform = b;
- scaleFactor = Math.min(c / minW, a / minH);
- stage.scaleX = 1;
- stage.scaleY = 1;
- stage.canvas.width = Math.min(c, maxW * scaleFactor);
- stage.canvas.height = Math.min(a, maxH * scaleFactor);
- if (isDesktop() && !isMobileOnlyResize) {
- var b = 10,
- g = getURLParameter("scale");
- g && (b = parseFloat(g));
- scaleFactor = Math.min(c / desctopMaxW, a / desctopMaxH);
- scaleFactor = Math.min(scaleFactor, b / zoomFactor);
- stage.canvas.width = Math.min(c, desctopMaxW * scaleFactor);
- stage.canvas.height = Math.min(a, desctopMaxH * scaleFactor)
- }
- stage.canvas.style.marginTop = "0px";
- stage.canvas.style.marginLeft = "0px";
- stage.canvas.style.left = Math.floor((c * zoomFactor - stage.canvas.width) / 2) + "px";
- stage.canvas.style.top =
- Math.floor((a * zoomFactor - stage.canvas.height) / 2) + "px";
- viewportH = stage.canvas.height / scaleFactor;
- viewportW = stage.canvas.width / scaleFactor;
- topVisionLine = -(viewportH - oh);
- stage.autoClear = !1;
- container.scaleX = scaleFactor;
- container.scaleY = scaleFactor;
- container.x = Math.round((stage.canvas.width - ow * scaleFactor) / 2);
- container.y = Math.round((stage.canvas.height - oh * scaleFactor) / 2);
- splashContainer && (splashContainer.scaleX = container.scaleX, splashContainer.scaleY = container.scaleY, splashContainer.x = container.x, splashContainer.y =
- container.y);
- winWidth = c;
- winHeight = a;
- timer = null;
- loaderBar && (loaderBar.y = (oh - barHeight) / 2 + deltaForVCenter());
- isAllFilesLoaded && isGameInited && updateInterfacePositions();
- isNeedCacheSizeUpdate = !0;
- isPhysicsDebugDraw && debugDraw && (debugCanvas.width = stage.canvas.width, debugCanvas.height = stage.canvas.height, debugCanvas.style.left = stage.canvas.style.left, debugCanvas.style.top = stage.canvas.style.top, debugCanvas.style.marginLeft = container.x + "px", debugCanvas.style.marginTop = container.y + "px");
- stage.update()
- }
- function isNeedCanvasZoom(c, a) {
- if (isDesktop()) return !1;
- var b = Math.min(c / minW, a / minH);
- return isDefaultAndroid() && 2 <= b
- }
- function sizeHandler() {}
- function deltaForVCenter() {
- return -(viewportH - oh) / 2
- }
- function deltaForVTop() {
- return -(viewportH - oh)
- }
- function deltaForHLeft() {
- return -(viewportW - ow) / 2
- }
- function getMaxLeft() {
- return -(maxW - ow) / 2
- }
- function getMaxRight() {
- return maxW + getMaxLeft()
- }
- function getMaxTop() {
- return -(maxH - oh)
- }
- function orientChange(c) {
- setTimeout(hideAdressBar, 50);
- onWindowResize(null)
- }
- function hideAdressBar() {
- window.scrollTo(0, 1)
- }
- function PreventScrollTouch(c) {
- window.scrollTo(0, 1);
- window.innerHeight != winHeight && onWindowResize(null);
- c.preventDefault();
- c.stopPropagation();
- c.cancelBubble = !0;
- return c.returnValue = !1
- }
- var timer;
- function onWindowResize(c) {
- setTimeout(hideAdressBar, 1);
- clearTimeout(timer);
- setTimeout(onGameResize, 1)
- }
- function setPixelRatio() {
- if (isHiDPI()) {
- var c = document.createElement("meta");
- c.name = "viewport";
- c.content = "target-densitydpi=device-dpi, user-scalable=0, initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5";
- document.getElementsByTagName("head")[0].appendChild(c)
- }
- }
- function isHiDPI() {
- return !window.hasOwnProperty("devicePixelRatio") || -1 == navigator.userAgent.indexOf("iPhone") && -1 == navigator.userAgent.indexOf("iPad") || 2 != window.devicePixelRatio ? !1 : !0
- }
- function getURLParameter(c) {
- return decodeURIComponent((RegExp("[?|&]" + c + "=([^&;]+?)(&|#|;|$)")
- .exec(location.search) || [, ""])[1].replace(/\+/g, "%20")) || null
- }
- function isMobileDetected(c) {
- return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|android|ipad|playbook|silk|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(c) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(c.substr(0,
- 4))
- }
- var MyGame = {},
- images, files;
- MyGame.init = function () {
- try {
- canvas = document.getElementById("canvas");
- images = images || {};
- files = files || {};
- stage = new createjs.Stage("canvas");
- container = new createjs.Container;
- container.isRoot = !0;
- container.width = ow;
- container.height = oh;
- stage.addChild(container);
- detectBrowser();
- blockContainer = new createjs.Container;
- splashContainer = new createjs.Container;
- splashContainer.width = ow;
- splashContainer.height = oh;
- particleContainer = new createjs.Container;
- rotationContainer = new createjs.Container;
- rotationContainer.width =
- ow;
- rotationContainer.height = oh;
- initResizeManager();
- createjs.Touch.enable(stage, !0);
- isDesktop() && stage.enableMouseOver(20);
- stage.mouseMoveOutside = !0;
- initLoaders();
- stage.update();
- var c = document.getElementById("loader");
- c && c.parentNode && c.parentNode.removeChild(c);
- onGameResize();
- initSpilApi()
- } catch (a) {
- trace(a.name + ":" + a.message)
- }
- };
- function isDesktop() {
- return isDesktopBrowser
- }
- function updateMobileBrowserParams() {
- MAX_PARTICLES_ON_SCREEN = isDesktopBrowser ? 30 : 12
- }
- function detectBrowser() {
- isDesktopBrowser = !isMobileDetected(navigator.userAgent || navigator.vendor || window.opera);
- var c = getURLParameter("mobile");
- c && 1 == parseInt(c) && (isDesktopBrowser = !1);
- updateMobileBrowserParams()
- }
- var loaderBar, bar, loaderWidth, barHeight = 20;
- function initLoaders() {
- var c = createjs.Graphics.getRGB(247, 247, 247);
- loaderBar = new createjs.Container;
- bar = new createjs.Shape;
- bar.graphics.beginFill(c)
- .drawRect(0, 0, 1, barHeight)
- .endFill();
- loaderWidth = 300;
- var a = new createjs.Shape;
- a.graphics.setStrokeStyle(2)
- .beginStroke(c)
- .drawRect(-5, -5, loaderWidth + 10, barHeight + 10);
- loaderBar.x = container.width - loaderWidth >> 1;
- loaderBar.y = container.height - barHeight >> 1;
- loaderBar.addChild(bar, a);
- container.addChild(loaderBar);
- initSoundManager();
- preload = new createjs.LoadQueue(!0,
- "assets/");
- preload.installPlugin(createjs.Sound);
- preload.addEventListener("progress", handleOverallProgress);
- preload.addEventListener("complete", handleComplete);
- preload.addEventListener("fileload", handleFileLoad);
- isLoadAnimFromJSON && manifest.push({
- src: "soccerassets.json",
- id: "anim_json"
- });
- preload.loadManifest(manifest);
- createjs.Ticker.timingMode = createjs.Ticker.RAF_SYNCHED;
- isDefaultAndroid() && (createjs.Ticker.timingMode = createjs.Ticker.TIMEOUT);
- createjs.Ticker.setFPS(FPS)
- }
- function isDefaultAndroid() {
- var c = navigator.userAgent;
- return -1 < c.indexOf("Mozilla/5.0") && -1 < c.indexOf("Android ") && -1 < c.indexOf("AppleWebKit") && !(-1 < c.indexOf("Chrome"))
- }
- function handleOverallProgress(c) {
- 0 != c.total && (bar.scaleX = c.loaded / c.total * loaderWidth, stage.update())
- }
- var fpsText, helperLabel, zoeSS, interfaceSS, bgSS, isPreloaderLogoReady = !1;
- function handleFileLoad(c) {
- "image" == c.item.type && (images[c.item.id] = c.result);
- files[c.item.id] = c.result;
- isLogoReady && "preloaderlogo" == c.item.id && showPreloaderLogo()
- }
- function showPreloaderLogo() {
- if (files.preloaderlogo && !isPreloaderLogoReady) {
- isPreloaderLogoReady = !0;
- var c = files.preloaderlogo,
- a = c.width,
- b = c.height,
- c = (new createjs.Bitmap(c))
- .set({
- scaleX: 0.75,
- scaleY: 0.75,
- regX: a / 2,
- regY: b / 2,
- cursor: "pointer",
- x: ow / 2,
- y: 20 + 0.75 * b
- });
- c.setBoundingBox(-a / 2, -b / 2, a, b);
- c.addEventListener("mousedown", sponsorClick);
- loaderBar.addChild(c)
- }
- }
- function sponsorClick(c) {
-
- // Play68.goHome();
-
- // window.open(SPONSOR_URL, "_blank")
- }
- function createRotationScreen() {
- var c = new createjs.Sprite(bgSS);
- c.gotoAndStop("rotateScreen");
- c.x = 30;
- rotationContainer.addChild(c)
- }
- var isAllFilesLoaded = !1;
- function handleComplete(c) {
- isAllFilesLoaded || (isLogoReady = isAllFilesLoaded = !0) && startGame()
- }
- function startGame() {
- try {
- isGameInited || (removeFromParent(loaderBar), loaderBar = null, configureSpritesheets(), isDefaultAndroid() && (isLowQuality = !0), createSplashScreen(), createRotationScreen(), createBG(), loadSaves(), initLevelManager(), initBonusManager(), initParticleManager(), isNeedFpsMeter && (fpsText = new createjs.BitmapText("1", interfaceSS), fpsText.scaleX = fpsText.scaleY = 0.6, fpsText.letterSpacing = -7, fpsText.x = ow - 27, container.addChild(fpsText)), initInterface(), isGameInited = !0, onGameResize(), startSplash(),
- isSkipMenus && (isLastLevelLoad ? loadLevel(allLevels.length - 1) : loadLevel(isDesignerSettingsPreferred ? editorLevelToLoad : autoLevelToLoad)), stage.update(), createjs.Ticker.addEventListener("tick", tick), initEditorHandlers(), isGetAllProperties && getAllProperties())
- } catch (c) {
- trace(c.name + ":" + c.message)
- }
- }
- var splashContainer;
- function startSplash() {
- isSkipSplash || isSponsorLogoError || !splashContainer || splashContainer.parent || rotationContainer.parent || (removeFromParent(container), stage.addChild(splashContainer), createjs.Tween.get(splashContainer)
- .wait(3E3)
- .call(addContainer)
- .to({
- alpha: 0
- }, 200)
- .call(disposeSplash), trace("splash"), stage.autoClear = !0)
- }
- function addContainer(c) {
- stage.addChildAt(container, 0)
- }
- function disposeSplash(c) {
- removeFromParent(splashContainer);
- splashContainer = null;
- stage.autoClear = winWidth > maxW * scaleFactor || winHeight > maxH * scaleFactor
- }
- function createSplashScreen() {
- var c = new createjs.Sprite(zoeSS);
- c.gotoAndStop("splashlogo");
- c.x = ow / 2;
- c.y = oh / 2;
- c.scaleX = c.scaleY = 0.8;
- c.mouseEnabled = !0;
- splashContainer.addChild(c)
- }
- function initEditorHandlers() {
- isLevelEditor && stage.addEventListener("stagemousedown", handlePress)
- }
- function updateBgCache() {}
- var mainBg, fansBg, allBgContainer, smallBg, isNeedCacheSizeUpdate = !1;
- function createBG() {
- allBgContainer = new createjs.Container;
- container.addChild(allBgContainer);
- mainBg = (new createjs.Sprite(bgSS))
- .set({
- x: -18,
- y: 495,
- rotation: -90
- });
- mainBg.gotoAndStop("bigbg");
- allBgContainer.addChild(mainBg);
- isLowQuality && (mainBg.gotoAndStop("smallbg"), setSpriteScale(mainBg, 2));
- fansBg = (new createjs.Sprite(bgSS, "fansv"))
- .set({
- x: -30,
- y: 312,
- scaleX: 1.15,
- scaleY: 1.15,
- rotation: 0
- });
- setAnimationSpeed(fansBg, 0.8);
- addToParent(fansBg, allBgContainer);
- allBgContainer.mouseEnabled = !1
- }
- var nameCounter = 0;
- function handlePress(c) {
- isLevelEditor && (KeyboardJS.isPressed("n") && loadNextLevel(), KeyboardJS.isPressed("l") && showLevelCompleteWin(), KeyboardJS.isPressed("a") && showAchievWin(SUPER_COLLECTOR_ACHIEV), KeyboardJS.isPressed("u") && updateBgCache(), KeyboardJS.isPressed("g") && showGameCompleteWin())
- }
- function configureSpritesheets() {
- isLoadAnimFromJSON && (zoeCFG = eval(files.anim_json));
- validateSpritesheetCFG(zoeCFG, "zoespritesheet", !0, 2);
- bgSS = interfaceSS = zoeSS = new createjs.SpriteSheet(zoeCFG)
- }
- function validateSpritesheetCFG(c, a, b, g) {
- var f = images[a].width;
- a = images[a].height;
- c = c.frames;
- for (var d = c.length, e, h = 0; h < d; h++) e = c[h], b && (e[2] -= 2 * g, e[3] -= 2 * g), e[0] + e[2] > f && (e[2] = f - e[0]), e[1] + e[3] > a && (e[3] = a - e[1]), 0 > e[0] && (e[0] = 0), 0 > e[1] && (e[1] = 0)
- }
- var counter = 0,
- animTicker = 0,
- toDisposePhysicsBodies = [],
- toDisposeChars = [],
- clickedChars = [],
- dtScale = 1,
- lastDelta = 0,
- FPS = 30,
- GAME_FPS = 30,
- defaultDelta = 1E3 / GAME_FPS,
- DEFAULT_WORLD_STEP = 1 / GAME_FPS,
- allHeroesLen = 0,
- lastTime = 0,
- data, step = 0;
- function tick(c) {
- if (isDesktop() || !isPageLeaved) {
- dtScale = c.delta / defaultDelta;
- if (!dtScale || 0 >= dtScale) dtScale = 1;
- 2 < dtScale && (dtScale = 2);
- lastDelta = c.delta;
- counter++;
- animTicker++;
- for (levelStartTimer++; 0 < toDisposePhysicsBodies.length;) c = toDisposePhysicsBodies.pop(), destroyBody(c);
- for (; 0 < toDisposeChars.length;) currentChar = toDisposeChars.pop(), currentChar.dispose();
- for (; 0 < clickedChars.length;) currentChar = clickedChars.pop(), currentChar.type === BOMB_TYPE ? currentChar.bombClick() : currentChar.type === FAN_TYPE ?
- currentChar.toggleFan() : currentChar.isGlass ? currentChar.breakGlass() : currentChar.physBody && (awakeAllBodies(), currentChar.removeFromField());
- isGamePaused || (step = DEFAULT_WORLD_STEP * (1.2 < dtScale ? 1.2 : dtScale), space.step(step / 2), space.step(step / 2));
- isPhysicsDebugDraw && debugDraw.draw();
- allHeroesLen = allHeroes.length;
- for (c = allChars.length - 1; 0 <= c; --c) allChars[c].tick();
- interfaceTick();
- updateBonusManager();
- updatePartManager();
- interfaceTick();
- isGameCompleteScreenShow && (MAX_PARTICLES_ON_SCREEN = 30, 0 == animTicker %
- Math.floor(FPS / 6) && createPartExplode(Math.random() * ow, Math.random() * oh, 6, PART_STAR_TYPE, gameCompleteContainer));
- isNeedFpsMeter && 0 == counter % FPS && (fpsText.text = Math.floor(createjs.Ticker.getMeasuredFPS())
- .toString());
- 30 < counter && isNeedCacheSizeUpdate && (isNeedCacheSizeUpdate = !1, isWithCache && allBgContainer.cache(0, 0, ow + 1, oh + 1, 2));
- c = 0;
- 0 < scoreToAdd && (c = Math.round(scoreToAdd / 7), currentLevelScore += c, scoreToAdd -= c, updateScoreLabel(currentLevelScore));
- //onWindowResize(null);
- onGameResize();
- stage.update()
- }
- }
- function trace(c) {
- isLevelEditor && console.log(c)
- }
- var currentBgIndex = 0;
- function showBgByLevelNum(c, a, b) {
- mainBg.currentAnimationFrame = a ? a : allBgIndexes[c]
- };
|