easyGame.js 167 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379
  1. function IsPC() {
  2. return false
  3. }
  4. function bomb(a, b) {
  5. this.x = b,
  6. this.y = a,
  7. this.k = 0,
  8. this.r = 6,
  9. this.j = 0
  10. }
  11. function stage(a, b, c, d, e) {
  12. this.dn3 = a,
  13. this.dn4 = d,
  14. this.t = 0,
  15. this.speed = c,
  16. this.text = b,
  17. this.img = e,
  18. this.title = [Attack.imgDx[81], Attack.imgDx[84]]
  19. }
  20. function explode(a, b, c) {
  21. this.x = a,
  22. this.y = b,
  23. this.r = 0,
  24. this.die = 0,
  25. this.type = c,
  26. this.t = 0
  27. }
  28. function sp(a, b, c, d, e, f, g, h) {
  29. this.x = a,
  30. this.y = b,
  31. this.h = c,
  32. this.m = g,
  33. this.n = h,
  34. this.img = e,
  35. this.die = 0,
  36. this.cos1 = Math.cos(d),
  37. this.sin1 = Math.sin(d),
  38. this.type = f,
  39. this.t = 0
  40. }
  41. function chena(a, b, c, d, e, f, g, h) {
  42. this.x = a,
  43. this.y = b,
  44. this.img = c,
  45. this.die = 0,
  46. this.mfx = d,
  47. this.type = e,
  48. this.width = f,
  49. this.hight = g,
  50. this.arc = h
  51. }
  52. function yun(a, b, c, d, e) {
  53. this.x = a,
  54. this.y = b,
  55. this.img = c,
  56. this.die = 0,
  57. this.fx = d,
  58. this.type = e,
  59. this.speed_x = random(1, 8),
  60. this.speed_y = random(1, 8)
  61. }
  62. function star(a, b, c) {
  63. this.x = a,
  64. this.y = b,
  65. this.rad = Math.PI / 10 * random(1, 21),
  66. 1 == c ? this.img = Attack.imgDx[28] : 2 == c ? this.img = Attack.imgDx[29] : 3 == c && (this.img = Attack.imgDx[30]),
  67. this.type = c,
  68. this.die = 0,
  69. this.st = 0
  70. }
  71. function random(a, b) {
  72. return Math.floor(a + Math.random() * (b - a))
  73. }
  74. function drStar() {
  75. var a = random(0, 2),
  76. b = random(1, 8),
  77. c = random(0, 4),
  78. d = [Attack.imgDx[27], Attack.imgDx[28], Attack.imgDx[29], Attack.imgDx[30]],
  79. e = new yun(50 * b, -250, d[c], a);
  80. Attack.s.push(e)
  81. }
  82. function enemyZc(a) {
  83. for (var b = Attack.enemylist.length,
  84. c = b; b + 6 > c; c++) Attack.enemylist[c] = new enemy(50 * (c - b) - 330, 30 * (c - b) - 220, Attack.imgDx[2], a, 50, 44, 1, 1, 50 + 6 * c, 30, 50, 1, 1)
  85. }
  86. function enemyZc2() {
  87. var a = Attack.enemylist.length;
  88. Attack.enemylist[a] = new enemy(50, 660, Attack.imgDx[84], 233, 222, 166, 14, 1, 30, 30, 50, 1, 1);
  89. var b = Attack.enemylist[a];
  90. b.fpao = function() {
  91. printbosspd15(b)
  92. }
  93. }
  94. function enemyZc3(a) {
  95. for (var b = Attack.enemylist.length,
  96. c = b; b + 6 > c; c++) Attack.enemylist[c] = new enemy(50 * (c - b) + 360, 30 * (c - b) + Attack.pos_y / 2 + 30, Attack.imgDx[2], a, 50, 44, 1, 1, 50 + 6 * c, 30, 70, 1, 1),
  97. Attack.enemylist[c].arc = Math.PI
  98. }
  99. function sBossZc5() {
  100. var a = Attack.enemylist.length;
  101. Attack.enemylist[a] = new enemy( - 240, 160, Attack.imgDx[55], 20, 55, 48, 8, 10, 78, 30, 65, 1, 1, 4);
  102. var b = Attack.enemylist[a];
  103. b.fpao = function() {
  104. printbosspd12(b)
  105. }
  106. }
  107. function sBossZc6() {
  108. var a = Attack.enemylist.length;
  109. Attack.enemylist[a] = new enemy( - 80, 120, Attack.imgDx[55], 12, 55, 48, 11, 10, 78, 30, 65, 1, 1, 4),
  110. Attack.enemylist[a].arc = -Math.PI / 2;
  111. var b = Attack.enemylist[a];
  112. b.fpao = function() {
  113. printbosspd13(b)
  114. }
  115. }
  116. function sBossZc6_2() {
  117. var a = Attack.enemylist.length;
  118. Attack.enemylist[a] = new enemy(380, 120, Attack.imgDx[55], 12, 55, 48, 11, 10, 78, 30, 65, 1, 1, 4),
  119. Attack.enemylist[a].arc = Math.PI / 2;
  120. var b = Attack.enemylist[a];
  121. b.fpao = function() {
  122. printbosspd13(b)
  123. }
  124. }
  125. function sBossZc6_3(a) {
  126. var b = Attack.enemylist.length;
  127. Attack.enemylist[b] = new enemy(a, -70, Attack.imgDx[55], 12, 55, 48, 11, 10, 78, 30, 65, 1, 1, 4),
  128. Attack.enemylist[b].arc = 0;
  129. var c = Attack.enemylist[b];
  130. c.fpao = function() {
  131. printbosspd13(c)
  132. }
  133. }
  134. function sBossZc4() {
  135. var a = Attack.enemylist.length;
  136. Attack.enemylist[a] = new enemy(100, -100, Attack.imgDx[51], 1510, 100, 92, 9, 6, 78, 46, 105, 2, 1, 3);
  137. var b = Attack.enemylist[a];
  138. b.fpao = function() {
  139. printbosspd11(b)
  140. }
  141. }
  142. function sBossZc2() {
  143. var a = Attack.enemylist.length;
  144. Attack.enemylist[a] = new enemy( - 100, 10, Attack.imgDx[4], 20, 27, 66, 12, 6, 78, 30, 55, 1, 1, 1);
  145. var b = Attack.enemylist[a];
  146. b.fpao = function() {
  147. printbosspd3(b)
  148. }
  149. }
  150. function sBossZc12() {
  151. var a = Attack.enemylist.length;
  152. Attack.enemylist[a] = new enemy(600, 10, Attack.imgDx[4], 20, 27, 66, 13, 6, 78, 26, 55, 1, 1, 1);
  153. var b = Attack.enemylist[a];
  154. b.fpao = function() {
  155. printbosspd3(b)
  156. }
  157. }
  158. function crzdj() {
  159. var a = Attack.enemylist.length;
  160. Attack.enemylist[a] = new enemy(115, 646, Attack.imgDx[24], 2590, 28, 46, 7, 3, 0, 75, 110, 1, 1),
  161. Attack.enemylist[a].tank = 5,
  162. Attack.enemylist[a + 1] = new enemy(105, 646, Attack.imgDx[25], 1190, 28, 46, 6, 3, 0, 45, 110, 1, 1),
  163. Attack.enemylist[a + 1].tank = 5,
  164. Attack.enemylist[a + 2] = new enemy(100, 600, Attack.imgDx[15], 1100, 48, 174, 5, 3, 0, 60, 80, 2, 1, 2),
  165. Attack.enemylist[a + 2].tank = 5;
  166. var b = Attack.enemylist[a + 2];
  167. b.fpao = function() {
  168. printbosspd6(b)
  169. };
  170. var c = Attack.enemylist[a + 1];
  171. c.fpao = function() {
  172. printbosspd8(c)
  173. };
  174. var d = Attack.enemylist[a];
  175. d.fpao = function() {
  176. printbosspd9(d)
  177. }
  178. }
  179. function boss() {
  180. var a = Attack.enemylist.length;
  181. Attack.enemylist[a] = new enemy(200, 600, Attack.imgDx[75], 940, 24, 268, 5, 3, 0, 80, 120, 1, 1),
  182. Attack.enemylist[a].tank = 6,
  183. Attack.enemylist[a + 1] = new enemy(11, 650, Attack.imgDx[76], 940, 189, 88, 5, 3, 0, 80, 120, 1, 1),
  184. Attack.enemylist[a + 2] = new enemy(224, 650, Attack.imgDx[77], 940, 189, 88, 5, 3, 0, 80, 120, 1, 1),
  185. Attack.enemylist[a + 3] = new enemy(154, 830, Attack.imgDx[78], 940, 116, 56, 5, 3, 0, 80, 120, 1, 1)
  186. }
  187. function boss2() {
  188. var a = Attack.enemylist.length;
  189. Attack.enemylist[a] = new enemy(184, 772, Attack.imgDx[81], 940, 120, 118, 15, 3, 0, 80, 120, 1, 1),
  190. Attack.enemylist[a].tank = 7;
  191. var b = Attack.enemylist[a];
  192. b.fpao = function() {
  193. bosspd2(b)
  194. },
  195. Attack.enemylist[a + 1] = new enemy(40, 600, Attack.imgDx[80], 940, 406, 174, 15, 3, 0, 80, 120, 1, 1),
  196. Attack.enemylist[a + 1].tank = 6;
  197. var c = Attack.enemylist[a + 1];
  198. c.fpao = function() {
  199. bosspd(c)
  200. }
  201. }
  202. function crPt3(a, b) {
  203. var c = Attack.tanklist.length,
  204. d = {
  205. img: Attack.imgDx[50],
  206. mfx: 1,
  207. type: 0
  208. };
  209. Attack.tanklist[c] = new enemy(a, b, Attack.imgDx[49], 16, 30, 30, 4, 3, 0, 0, 0, 1, 1, 0, d),
  210. Attack.tanklist[c].tank = 2;
  211. var e = Attack.tanklist[c];
  212. e.fpao = function() {
  213. printbosspd4(e)
  214. }
  215. }
  216. function crPt5() {
  217. var a = Attack.tanklist.length,
  218. b = {
  219. img: Attack.imgDx[47],
  220. mfx: 1,
  221. type: 0
  222. };
  223. Attack.tanklist[a] = new enemy(250, -100, Attack.imgDx[9], 34, 26, 46, 10, 3, 0, 0, 0, 1, 1, 0, b),
  224. Attack.tanklist[a].tank = 1;
  225. var c = Attack.tanklist[a];
  226. c.fpao = function() {
  227. printbosspd7(c)
  228. }
  229. }
  230. function crPt2() {
  231. var a = Attack.tanklist.length,
  232. b = {
  233. img: Attack.imgDx[47],
  234. mfx: 1,
  235. type: 0
  236. };
  237. Attack.tanklist[a] = new enemy(300, -100, Attack.imgDx[9], 24, 26, 46, 3, 3, 0, 0, 0, 1, 1, 0, b),
  238. Attack.tanklist[a].tank = 1;
  239. var c = Attack.tanklist[a];
  240. c.fpao = function() {
  241. printbosspd7(c)
  242. }
  243. }
  244. function crPt7(a, b) {
  245. var c = Attack.tanklist.length,
  246. d = {
  247. img: Attack.imgDx[47],
  248. mfx: 1,
  249. type: 0
  250. };
  251. Attack.tanklist[c] = new enemy(a, b, Attack.imgDx[9], 26, 26, 46, 2, 3, 0, 0, 0, 1, 1, 0, d),
  252. Attack.tanklist[c].tank = 1;
  253. var e = Attack.tanklist[c];
  254. e.fpao = function() {
  255. printbosspd7(e)
  256. }
  257. }
  258. function crPt6(a, b) {
  259. var c = Attack.tanklist.length,
  260. d = {
  261. img: Attack.imgDx[47],
  262. mfx: 1,
  263. type: 0
  264. };
  265. Attack.tanklist[c] = new enemy(a, b, Attack.imgDx[72], 60, 26, 46, 3, 3, 0, 0, 0, 1, 1, 0, d),
  266. Attack.tanklist[c].tank = 4;
  267. var e = Attack.tanklist[c];
  268. e.fpao = function() {
  269. printbosspd17(e)
  270. }
  271. }
  272. function crPt4(a, b) {
  273. var c = Attack.tanklist.length,
  274. d = {
  275. img: Attack.imgDx[60],
  276. mfx: 1,
  277. type: 0
  278. };
  279. Attack.tanklist[c] = new enemy(a, b, Attack.imgDx[58], 16, 30, 37, 4, 3, 0, 0, 0, 1, 1, 0, d),
  280. Attack.tanklist[c].tank = 3;
  281. var e = Attack.tanklist[c];
  282. e.fpao = function() {
  283. printbosspd10(e)
  284. }
  285. }
  286. function sBossZc3() {
  287. var a = Attack.enemylist.length;
  288. Attack.enemylist[a] = new enemy(360, -250, Attack.imgDx[19], 340, 241, 114, 8, 3, 0, 30, 120, 1, 2);
  289. var b = Attack.enemylist[a];
  290. b.arc = Math.PI,
  291. b.fpao = function() {
  292. printbosspd2(b, 34)
  293. },
  294. Attack.enemylist[a + 1] = new enemy( - 10, -200, Attack.imgDx[19], 340, 241, 114, 9, 3, 0, 30, 120, 1, 2);
  295. var c = Attack.enemylist[a + 1];
  296. c.arc = Math.PI,
  297. c.fpao = function() {
  298. printbosspd2(c, 14)
  299. }
  300. }
  301. function printbosspd(a, b, c) {
  302. a.t > 75 && a.t2 == c && (a.arc = Math.PI / 10 * Math.sin(Math.PI / 40 * a.t * b), a.fire(a.x + 18, a.y + 66, 22, 0, 34, Math.PI - a.arc), a.fire(a.x + 33, a.y + 66, 22, 0, 34, Math.PI - a.arc)),
  303. a.t2 == c && (a.t2 = 0)
  304. }
  305. function printbosspd3(a) { (0 == a.t2 % 120 || 16 == a.t2 % 120) && a.fire(a.x + 14, a.y + 34, 3, 3, 3, 0, 3 + a.t2 % 120 / 32)
  306. }
  307. function printbosspd8(a) {
  308. if (1 == a.t2 && (sj_8 = random(1, 4)), a.t2 > 176 && a.t2 < 276 && 240 == a.t2 && a.fire(a.x + 20, a.y + 9, 7, 0, 0), 176 == a.t2) {
  309. var b = a.x + a.width / 2 - Attack.player.x - 43,
  310. c = a.y + a.hight / 2 - Attack.player.y - 36,
  311. d = Math.sqrt(b * b + c * c),
  312. e = b / d;
  313. a.arc3 = c > 0 ? Math.PI - Math.asin(e) : Math.asin(e),
  314. a.moveto(a.arc3)
  315. }
  316. if (a.t2 > 176 && a.t2 <= 196 && (a.arc2 -= a.a_arc), 1 == sj_8 && a.t2 > 176 && a.t2 < 226 && 0 == a.t2 % 4 && (a.arc2 -= Math.PI / 50, a.fire(a.x + 14 + 3, a.y + 48, 18, 0, 0, Math.PI - a.arc2, (a.t2 - 176) / 8 + 4), a.fire(a.x + 14 - 3, a.y + 48, 18, 0, 0, Math.PI - a.arc2, (a.t2 - 176) / 8 + 4)), 2 == sj_8 && a.t2 > 196 && a.t2 < 226 && 0 == a.t2 % 5 && (a.arc2 += Math.PI / 100, a.fire(a.x + 14 + 3, a.y + 48, 9, 0, 0, Math.PI - a.arc2, (a.t2 - 196) / 10 + 4), a.fire(a.x + 14 - 3, a.y + 48, 9, 0, 0, Math.PI - a.arc2, (a.t2 - 176) / 10 + 4)), 3 == sj_8 && a.t2 > 196 && a.t2 < 206 && 0 == a.t2 % 3) for (var g = 0; 8 > g; g++) {
  317. var h = random( - 4, 4);
  318. a.fire(a.x + 14, a.y + 48, 6, 8, 10, Math.PI - a.arc2 + Math.PI / 20 * h + 1 * Math.PI / 14, (a.t2 - 196) / 6 + 3)
  319. }
  320. 302 == a.t2 && (a.t2 = 0)
  321. }
  322. function printbosspd9(a) {
  323. if (a.t2 > 176 && a.t2 < 276 && 240 == a.t2 && a.fire(a.x + 20, a.y + 9, 8, 0, 0), 176 == a.t2) {
  324. var b = a.x + a.width / 2 - Attack.player.x - 43,
  325. c = a.y + a.hight / 2 - Attack.player.y - 36,
  326. d = Math.sqrt(b * b + c * c),
  327. e = b / d;
  328. a.arc3 = c > 0 ? Math.PI - Math.asin(e) : Math.asin(e),
  329. a.moveto(a.arc3)
  330. }
  331. if (a.t2 > 176 && a.t2 <= 196 && (a.arc2 -= a.a_arc), 1 == sj_8 && a.t2 > 176 && a.t2 < 226 && 0 == a.t2 % 4 && (a.arc2 += Math.PI / 50, a.fire(a.x + 14 + 3, a.y + 48, 18, 0, 0, Math.PI - a.arc2, (a.t2 - 176) / 8 + 4), a.fire(a.x + 14 - 3, a.y + 48, 18, 0, 0, Math.PI - a.arc2, (a.t2 - 176) / 8 + 4)), 2 == sj_8 && a.t2 > 196 && a.t2 < 226 && 0 == a.t2 % 5 && (a.arc2 -= Math.PI / 100, a.fire(a.x + 14 + 3, a.y + 48, 9, 0, 0, Math.PI - a.arc2, (a.t2 - 196) / 10 + 4), a.fire(a.x + 14 - 3, a.y + 48, 9, 0, 0, Math.PI - a.arc2, (a.t2 - 176) / 10 + 4)), 3 == sj_8 && a.t2 > 196 && a.t2 < 206 && 0 == a.t2 % 3) for (var g = 0; 8 > g; g++) {
  332. var h = random( - 4, 4);
  333. a.fire(a.x + 14, a.y + 48, 6, 8, 10, Math.PI - a.arc2 + Math.PI / 20 * h + 1 * Math.PI / 14, (a.t2 - 196) / 6 + 3)
  334. }
  335. 302 == a.t2 && (a.t2 = 0)
  336. }
  337. function printbosspd11(a) {
  338. if (0 == a.t2 % 150 && (sj_11 = random(1, 6)), 1 == sj_11 && (108 == a.t2 % 150 || 128 == a.t2 % 150)) {
  339. a.arc3 -= Math.PI / 20;
  340. for (var b = 0; 12 > b; b++) a.fire(a.x + 50, a.y + 46, 15, 8, 16, Math.PI / 6 * b - a.arc3)
  341. }
  342. if (4 == sj_11 && 2 == a.t2 % 150 % 5 && (a.arc3 -= Math.PI / 8, a.fire(a.x + 50, a.y + 46, 25, 16, 16, a.arc3, 4), a.fire(a.x + 50, a.y + 46, 25, 16, 16, Math.PI + a.arc3, 4)), 5 == sj_11 && 2 == a.t2 % 150 % 8 && (a.arc3 -= Math.PI / 10, a.fire(a.x + 50, a.y + 46, 15, 8, 16, a.arc3), a.fire(a.x + 50, a.y + 46, 15, 8, 16, Math.PI + a.arc3)), 1 == sj_11 && (88 == a.t2 % 150 || 98 == a.t2 % 150 || 78 == a.t2 % 150)) {
  343. a.arc3 -= Math.PI / 20;
  344. for (var b = 0; 10 > b; b++) a.fire(a.x + 50, a.y + 46, 26, 16, 16, Math.PI / 5 * b - a.arc3, 3)
  345. }
  346. if (2 == sj_11 && 0 == a.t2 % 150 % 75) {
  347. var c = a.x + a.width / 2 - Attack.player.x - 43,
  348. d = a.y + a.hight / 2 - Attack.player.y - 36,
  349. e = Math.sqrt(c * c + d * d),
  350. f = c / e;
  351. a.arc3 = d > 0 ? Math.PI - Math.asin(f) : Math.asin(f)
  352. }
  353. if (2 == sj_11 && 0 == a.t2 % 150 % 75 % 6 && a.t2 % 150 % 75 < 24) {
  354. a.arc3 += Math.PI / 80;
  355. for (var b = 0; 5 > b; b++) a.fire(a.x + 50, a.y + 27, 23, 3, 6, Math.PI - Math.PI / 14 * (3 - b) - a.arc3, a.t2 % 150 % 75 / 12 + 5)
  356. }
  357. 3 == sj_11 && 5 == a.t2 % 150 % 25 && a.t2 % 150 < 120 && (a.fire(a.x + 60, a.y + 66, 8, 0, 0), a.fire(a.x + 85, a.y + 66, 7, 0, 0))
  358. }
  359. function printbosspd15(a) {
  360. if (0 == a.t2 % 150) {
  361. var b = a.x + a.width / 2 - Attack.player.x - 43,
  362. c = a.y + a.hight / 2 - Attack.player.y - 36,
  363. d = Math.sqrt(b * b + c * c),
  364. e = b / d;
  365. a.arc3 = c > 0 ? Math.PI - Math.asin(e) : Math.asin(e)
  366. }
  367. if (88 == a.t2 % 150 || 98 == a.t2 % 150 || 78 == a.t2 % 150) {
  368. a.arc3 -= Math.PI / 20;
  369. for (var g = 0; 5 > g; g++) a.fire(a.x + 111 + 70, a.y + 47, 6, 0, 0, Math.PI / 5 * g - a.arc3 + Math.PI / 2, (a.t2 % 150 - 88) / 10 + 3),
  370. a.fire(a.x + 111 - 70, a.y + 47, 6, 0, 0, Math.PI / 5 * g - a.arc3 + Math.PI / 2, (a.t2 % 150 - 88) / 10 + 3),
  371. a.fire(a.x + 111, a.y + 47, 26, 10, 10, Math.PI / 5 * g - a.arc3 + Math.PI / 2, 3)
  372. }
  373. }
  374. function printbosspd12(a) {
  375. if (68 == a.t2) {
  376. var b = random( - 10, 10);
  377. a.fire(a.x + 41, a.y + 36, 11, 16, 16, Math.PI - Math.PI / 20 * b)
  378. }
  379. 150 == a.t2 && (a.t2 = 0)
  380. }
  381. function printbosspd13(a) {
  382. if (0 == a.t2 % 30) {
  383. var b = random( - 10, 10);
  384. a.fire(a.x + 41, a.y + 36, 17, 2, 2, 1 * b * Math.PI / 5)
  385. }
  386. if (10 == a.t2 % 30) {
  387. var b = random( - 10, 10);
  388. a.fire(a.x + 41, a.y + 36, 17, 2, 2, 1 * b * Math.PI / 5)
  389. }
  390. }
  391. function bosspd(a) {
  392. var b = a.t % 200;
  393. if (1 == b && (sj_1 = random(1, 4)), 2 == sj_1 || 3 == sj_1) {
  394. var c = a.x + a.width / 2 - Attack.player.x - 43,
  395. d = a.y + a.hight / 2 - Attack.player.y - 36,
  396. e = Math.sqrt(c * c + d * d),
  397. f = c / e;
  398. a.arc3 = d > 0 ? Math.PI - Math.asin(f) : Math.asin(f),
  399. a.moveto(a.arc3)
  400. }
  401. if (1 == sj_1 && 79 == b) {
  402. var c = a.x + a.width / 2 - Attack.player.x - 43,
  403. d = a.y + a.hight / 2 - Attack.player.y - 36,
  404. e = Math.sqrt(c * c + d * d),
  405. f = c / e;
  406. a.arc3 = d > 0 ? Math.PI - Math.asin(f) : Math.asin(f),
  407. a.moveto(a.arc3)
  408. }
  409. if (2 == sj_1 && 20 >= b && (a.arc2 -= a.a_arc), 3 == sj_1 && 20 >= b && (a.arc2 -= a.a_arc), 1 == sj_1 && b > 80 && 100 >= b && (a.arc2 -= a.a_arc), 1 == sj_1 && b > 100 && 170 > b && 0 == b % 5) for (var h = 0; 5 > h; h++) a.fire(a.x + 199, a.y + 122, 25, 0, 0, Math.PI - a.arc2 + Math.PI / 15 * (3 - h), (b - 100) % 35 / 10 + 6, 2),
  410. a.fire(a.x + 207, a.y + 122, 25, 0, 0, Math.PI - a.arc2 - Math.PI / 15 * (3 - h), (b - 100) % 35 / 10 + 6, 2);
  411. if (2 == sj_1 && b > 20 && 140 > b && (a.arc2 += Math.PI / 30, a.fire(a.x + 199, a.y + 122, 23, 0, 0, Math.PI - a.arc2, (b - 20) / 30 + 4, 2), a.fire(a.x + 207, a.y + 122, 23, 0, 0, Math.PI - a.arc2, (b - 20) / 30 + 4, 2)), 2 == sj_1 && b > 20 && 140 == b && (a.arc2 -= 4 * Math.PI), 3 == sj_1 && b > 20 && 30 > b && 0 == b % 2) for (var h = 0; 10 > h; h++) {
  412. var i = random( - 4, 4);
  413. a.fire(a.x + 199, a.y + 122, 6, 14, 20, Math.PI - a.arc2 + Math.PI / 20 * i + 1 * Math.PI / 14, (b - 20) / 4 + 3, 2),
  414. a.fire(a.x + 207, a.y + 122, 6, 14, 20, Math.PI - a.arc2 + Math.PI / 20 * i + 1 * Math.PI / 14, (b - 20) / 4 + 3, 2)
  415. }
  416. }
  417. function bosspd2(a) {
  418. var b = a.t % 200;
  419. if (1 == sj_1 && 20 > b && (a.arc2 = 0), 1 == sj_1 && b > 20 && 60 > b && 0 == b % 3 && (a.arc2 -= Math.PI / 50, a.fire(a.x + 56, a.y + 95, 23, 0, 0, Math.PI - a.arc2, (b - 20) / 20 + 4, 3), a.fire(a.x + 64, a.y + 95, 23, 0, 0, Math.PI - a.arc2, (b - 20) / 20 + 4, 3), a.fire(a.x + 56, a.y + 95, 23, 0, 0, Math.PI - a.arc2, (b - 20) / 20 + 4, 4), a.fire(a.x + 64, a.y + 95, 23, 0, 0, Math.PI - a.arc2, (b - 20) / 20 + 4, 4)), 1 == sj_1 && b > 60 && 100 > b && 0 == b % 3 && (a.arc2 += Math.PI / 30, a.fire(a.x + 56, a.y + 95, 23, 0, 0, Math.PI - a.arc2, (b - 20) / 20 + 4, 3), a.fire(a.x + 64, a.y + 95, 23, 0, 0, Math.PI - a.arc2, (b - 20) / 20 + 4, 3), a.fire(a.x + 56, a.y + 95, 23, 0, 0, Math.PI - a.arc2, (b - 20) / 20 + 4, 4), a.fire(a.x + 64, a.y + 95, 23, 0, 0, Math.PI - a.arc2, (b - 20) / 20 + 4, 4)), 1 == sj_1 && 20 > b && (a.arc4 = 0), 1 == sj_1 && b > 20 && 60 > b && 0 == b % 2 && (a.arc4 += Math.PI / 50, a.fire(a.x + 56, a.y + 95, 23, 0, 0, Math.PI - a.arc4, (b - 20) / 20 + 4, 5), a.fire(a.x + 64, a.y + 95, 23, 0, 0, Math.PI - a.arc4, (b - 20) / 20 + 4, 5), a.fire(a.x + 56, a.y + 95, 23, 0, 0, Math.PI - a.arc4, (b - 20) / 20 + 4, 6), a.fire(a.x + 64, a.y + 95, 23, 0, 0, Math.PI - a.arc4, (b - 20) / 20 + 4, 6)), 1 == sj_1 && b > 60 && 100 > b && 0 == b % 2 && (a.arc4 -= Math.PI / 50, a.fire(a.x + 56, a.y + 95, 23, 0, 0, Math.PI - a.arc4, (b - 20) / 20 + 4, 5), a.fire(a.x + 64, a.y + 95, 23, 0, 0, Math.PI - a.arc4, (b - 20) / 20 + 4, 5), a.fire(a.x + 56, a.y + 95, 23, 0, 0, Math.PI - a.arc4, (b - 20) / 20 + 4, 6), a.fire(a.x + 64, a.y + 95, 23, 0, 0, Math.PI - a.arc4, (b - 20) / 20 + 4, 6)), 3 == sj_1 && b > 40 && 50 > b && 0 == b % 2) for (var c = 0; 10 > c; c++) {
  420. var d = random( - 4, 4);
  421. a.fire(a.x + 56, a.y + 95, 6, 14, 20, Math.PI - a.arc4 + Math.PI / 15 * d + 1 * Math.PI / 14, (b - 40) / 4 + 3, 6),
  422. a.fire(a.x + 64, a.y + 95, 6, 14, 20, Math.PI - a.arc4 + Math.PI / 15 * d + 1 * Math.PI / 14, (b - 40) / 4 + 3, 6)
  423. }
  424. if (3 == sj_1 && b > 60 && 70 > b && 0 == b % 2) for (var c = 0; 10 > c; c++) {
  425. var d = random( - 4, 4);
  426. a.fire(a.x + 56, a.y + 95, 6, 14, 20, Math.PI - a.arc4 + Math.PI / 15 * d + 1 * Math.PI / 14, (b - 60) / 4 + 3, 5),
  427. a.fire(a.x + 64, a.y + 95, 6, 14, 20, Math.PI - a.arc4 + Math.PI / 15 * d + 1 * Math.PI / 14, (b - 60) / 4 + 3, 5)
  428. }
  429. }
  430. function printbosspd6(a) {
  431. var b = random( - 20, 20),
  432. c = a.t % 140;
  433. if (1 == c) {
  434. rad4 = random(1, 6);
  435. var d = a.x + a.width / 2 - Attack.player.x - 43,
  436. e = a.y + a.hight / 2 - Attack.player.y - 36,
  437. f = Math.sqrt(d * d + e * e),
  438. g = d / f;
  439. a.arc3 = e > 0 ? Math.PI - Math.asin(g) : Math.asin(g),
  440. a.moveto(a.arc3)
  441. }
  442. if (20 >= c && (a.arc2 -= a.a_arc), 1 == rad4 && c > 20 && 50 > c && 0 == c % 3 && (a.arc2 += Math.PI / 40, a.fire(a.x + 24 - 3, a.y + 112, 4, 0, 0, Math.PI - a.arc2, (c - 20) / 6 + 4), a.fire(a.x + 24 + 3, a.y + 112, 4, 0, 0, Math.PI - a.arc2, (c - 20) / 6 + 4)), 1 == rad4 && c > 50 && 80 > c && 0 == c % 3 && (a.fire(a.x + 24 - 3, a.y + 112, 4, 0, 0, Math.PI - a.arc2 - Math.PI / 50 * (c - 50) / 6, (c - 50) / 6 + 4), a.fire(a.x + 24 + 3, a.y + 112, 4, 0, 0, Math.PI - a.arc2 + Math.PI / 50 * (c - 50) / 6, (c - 50) / 6 + 4)), 1 == rad4 && c > 80 && 110 > c && 0 == c % 3 && (a.arc2 -= Math.PI / 20, a.fire(a.x + 24 - 3, a.y + 112, 4, 0, 0, Math.PI - a.arc2, (c - 80) / 6 + 4), a.fire(a.x + 24 + 3, a.y + 112, 4, 0, 0, Math.PI - a.arc2, (c - 80) / 6 + 4)), 2 == rad4 && c > 80 && 110 > c && 0 == c % 6) for (var i = 0; 5 > i; i++) a.fire(a.x + 24 - 3, a.y + 112, 9, 0, 0, Math.PI - a.arc2 + Math.PI / 15 * (3 - i), 6),
  443. a.fire(a.x + 24 + 3, a.y + 112, 9, 0, 0, Math.PI - a.arc2 + Math.PI / 15 * (3 - i), 6);
  444. if (2 == rad4 && c > 20 && 70 > c && 0 == c % 6 && (a.fire(a.x + 24 - 3, a.y + 112, 9, 0, 0, Math.PI - a.arc2 - Math.PI / 50 * (c / 6), (c - 20) / 6 + 3), a.fire(a.x + 24 + 3, a.y + 112, 9, 0, 0, Math.PI - a.arc2 + Math.PI / 50 * (c / 6), (c - 20) / 6 + 3)), 3 == rad4 && c > 20 && 40 > c && 0 == c % 4) {
  445. a.arc2 -= Math.PI / 20;
  446. var b = random( - 4, 4);
  447. a.fire(a.x + 24, a.y + 112, 15, 12, 20, Math.PI - a.arc2 + Math.PI / 20 * b + 1 * Math.PI / 14, (c - 20) / 4 + 3)
  448. }
  449. if (3 == rad4 && c > 40 && 60 > c && 0 == c % 4 && (a.arc2 += Math.PI / 20, a.fire(a.x + 24, a.y + 112, 15, 8, 20, Math.PI - a.arc2, (c - 40) / 4 + 3)), 4 == rad4 && c > 20 && 120 > c && 0 == c % 2 && (40 > c ? (a.arc2 += Math.PI / 16, a.fire(a.x + 24 - 3, a.y + 112, 18, 0, 0, Math.PI - a.arc2, (c - 20) / 8 + 3), a.fire(a.x + 24 + 3, a.y + 112, 18, 0, 0, Math.PI - a.arc2, (c - 20) / 8 + 3)) : 80 > c ? (a.arc2 -= Math.PI / 16, a.fire(a.x + 24 - 3, a.y + 112, 18, 0, 0, Math.PI - a.arc2, (c - 40) / 8 + 4), a.fire(a.x + 24 + 3, a.y + 112, 18, 0, 0, Math.PI - a.arc2, (c - 40) / 8 + 4)) : 120 > c && (a.arc2 += Math.PI / 16, a.fire(a.x + 24 - 3, a.y + 112, 18, 0, 0, Math.PI - a.arc2, (c - 80) / 8 + 5), a.fire(a.x + 24 + 3, a.y + 112, 18, 0, 0, Math.PI - a.arc2, (c - 80) / 8 + 5))), 5 == rad4 && c > 20 && 1 == c % 30) {
  450. var d = a.x + a.width / 2 - Attack.player.x - 43,
  451. e = a.y + a.hight / 2 - Attack.player.y - 36,
  452. f = Math.sqrt(d * d + e * e),
  453. g = d / f;
  454. a.arc3 = e > 0 ? Math.PI - Math.asin(g) : Math.asin(g),
  455. a.moveto(a.arc3)
  456. }
  457. if (5 == rad4 && c > 20 && 20 > c % 30 && (a.arc2 -= a.a_arc), 5 == rad4 && 0 == c % 30 % 3 && c % 30 > 20 && 30 > c % 30) {
  458. a.arc2 -= Math.PI / 20;
  459. for (var i = 0; 3 > i; i++) a.fire(a.x + 24, a.y + 112, 26, 10, 10, Math.PI - Math.PI / 20 * (2 - i) - a.arc2, c % 30 / 9 + 3)
  460. }
  461. }
  462. function printbosspd17(a) {
  463. var b = a.x - Attack.player.x - 20,
  464. c = a.y - Attack.player.y - 25,
  465. d = Math.sqrt(b * b + c * c),
  466. e = b / d;
  467. a.arc3 = c > 0 ? Math.PI - Math.asin(e) : Math.asin(e),
  468. 1 == a.t2 && a.moveto(a.arc3),
  469. a.t2 <= 20 && (a.arc2 -= a.a_arc),
  470. a.t2 > 20 && a.t2 < 52 && 0 == a.t2 % 100 % 10 && (a.fire(a.x + 11 - 3, a.y + 56, 19, 7, 10, Math.PI - a.arc2, (a.t2 - 20) % 100 / 20 + 5), a.fire(a.x + 11 + 3, a.y + 56, 19, 7, 10, Math.PI - a.arc2 + Math.PI / 40, (a.t2 - 20) % 100 / 20 + 5), a.fire(a.x + 11 + 3, a.y + 56, 19, 7, 10, Math.PI - a.arc2, (a.t2 - 20) % 100 / 20 + 5), a.fire(a.x + 11 - 3, a.y + 56, 19, 7, 10, Math.PI - a.arc2 - Math.PI / 40, (a.t2 - 20) % 100 / 20 + 5)),
  471. 130 == a.t2 && (a.t2 = 0)
  472. }
  473. function printbosspd7(a) {
  474. var b = a.x - Attack.player.x - 20,
  475. c = a.y - Attack.player.y - 25,
  476. d = Math.sqrt(b * b + c * c),
  477. e = b / d;
  478. a.arc3 = c > 0 ? Math.PI - Math.asin(e) : Math.asin(e),
  479. 1 == a.t2 && a.moveto(a.arc3),
  480. a.t2 <= 20 && (a.arc2 -= a.a_arc),
  481. a.t2 > 20 && a.t2 < 50 && 0 == a.t2 % 9 && (a.arc2 += Math.PI / 180, a.fire(a.x + 13, a.y + 46, 19, 7, 10, Math.PI - a.arc2, (a.t2 - 20) / 45 + 4)),
  482. 100 == a.t2 && (a.t2 = 0)
  483. }
  484. function printbosspd10(a) {
  485. var b = a.x - Attack.player.x - 20,
  486. c = a.y - Attack.player.y - 25,
  487. d = Math.sqrt(b * b + c * c),
  488. e = b / d;
  489. arc5 = c > 0 ? Math.PI - Math.asin(e) : Math.asin(e),
  490. 1 == a.t2 && a.moveto(arc5),
  491. a.t2 <= 20 && (a.arc2 -= a.a_arc),
  492. 21 == a.t2 && a.fire(a.x + 16, a.y + 43, 5, 7, 10, Math.PI - a.arc2, 3),
  493. 84 == a.t2 && (a.t2 = 0)
  494. }
  495. function printbosspd5(a) {
  496. if (86 == a.t2 || 88 == a.t2 || 90 == a.t2 || 92 == a.t2 || 94 == a.t2 || 96 == a.t2 || 98 == a.t2 || 100 == a.t2) {
  497. var b = random( - 13, 13);
  498. a.fire(a.x + 12, a.y + 65, 23, 0, 0, Math.PI - a.arc + b * Math.PI / 100),
  499. a.fire(a.x + 76, a.y + 65, 23, 0, 0, Math.PI - a.arc + b * Math.PI / 100),
  500. a.fire(a.x + 40, a.y + 65, 22, 0, 0, Math.PI - a.arc + b * Math.PI / 100)
  501. }
  502. if (102 == a.t2 || 103 == a.t2 || 104 == a.t2 || 106 == a.t2 || 107 == a.t2) {
  503. var b = random( - 13, 13);
  504. a.fire(a.x + 12, a.y + 65, 23, 0, 0, Math.PI - a.arc + b * Math.PI / 100),
  505. a.fire(a.x + 76, a.y + 65, 23, 0, 0, Math.PI - a.arc + b * Math.PI / 100)
  506. }
  507. 110 == a.t2 && (a.t2 = 0)
  508. }
  509. function printbosspd4(a) {
  510. var b = a.x - Attack.player.x - 20,
  511. c = a.y - Attack.player.y - 25,
  512. d = Math.sqrt(b * b + c * c),
  513. e = b / d;
  514. arc6 = c > 0 ? Math.PI - Math.asin(e) : Math.asin(e),
  515. 1 == a.t2 && a.moveto(arc6),
  516. a.t2 <= 20 && (a.arc2 -= a.a_arc),
  517. (22 == a.t2 || 44 == a.t2) && (a.arc2 += Math.PI / 120, a.fire(a.x + 15, a.y + 40, 18, 3, 3, Math.PI - a.arc2, (a.t2 - 22) / 44 + 4)),
  518. 150 == a.t2 && (a.t2 = 0)
  519. } !
  520. function(a) {
  521. var b = function() {
  522. var c = {},
  523. d = arguments[0],
  524. e = d.canvas,
  525. f = e.width,
  526. g = e.height;
  527. return e.getContext("2d"),
  528. c = {
  529. objList: [],
  530. imgList: {},
  531. getImg: function(a) {
  532. return this.imgList[a]
  533. },
  534. canvas: e,
  535. fps: d.fps,
  536. timeline: 0,
  537. ctx: e.getContext("2d"),
  538. canWidth: f,
  539. canHeight: g,
  540. loading: function(a, b) {
  541. this.l_t = 0,
  542. this.imgList.length = 0;
  543. for (var c = 0; c < a.length; c++) {
  544. var d = a[c];
  545. this.imgList[d.id] = new Image,
  546. this.imgList[d.id].src = d.url,
  547. this.imgList.length++
  548. }
  549. this.loadfuc = b;
  550. var e = this;
  551. this.loadTimer = setInterval(function() {
  552. e.drawLoading()
  553. },
  554. 30)
  555. },
  556. setEmpty: function() {
  557. this.objList = [],
  558. this.offtimefuc(),
  559. b.eventList = {}
  560. },
  561. createLayer: function(a) {
  562. var b = [];
  563. return ! a || a >= this.objList.length - 1 ? this.objList.push(b) : 0 >= a ? this.objList.unshift(b) : this.objList.splice(a, 0, b),
  564. b
  565. },
  566. drawLoading: function() {
  567. var a = 0,
  568. b = this.ctx,
  569. c = this.canWidth,
  570. d = this.canHeight,
  571. e = this.imgList.length;
  572. for (i in this.imgList)"length" != i && this.imgList[i].complete && a++;
  573. b.beginPath(),
  574. b.clearRect(0, 0, c, d),
  575. b.fillStyle = "#000",
  576. b.fillRect(0, 0, c, d),
  577. b.drawImage(loadImg1, 55, d / 2 - 17),
  578. b.beginPath(),
  579. b.fillStyle = "#4B9D3C",
  580. b.fillRect(72, d / 2 - 10, (c - 146) / e * a, 23),
  581. b.fill(),
  582. b.beginPath(),
  583. b.arc(72 + (c - 146) / e * a, d / 2 + 2, 11, Math.PI / 2, 3 * Math.PI / 2, 1),
  584. b.fillStyle = "#4B9D3C",
  585. b.fill(),
  586. b.closePath(),
  587. b.beginPath(),
  588. b.arc(72, d / 2 + 2, 11, 3 * Math.PI / 2, Math.PI / 2, 1),
  589. b.fillStyle = "#4B9D3C",
  590. b.fill(),
  591. b.closePath(),
  592. b.save(),
  593. b.beginPath(),
  594. b.fillStyle = "#fff",
  595. b.font = "bold 18px Arial",
  596. b.shadowColor = "#000",
  597. b.shadowOffsetY = 1,
  598. b.textAlign = "center",
  599. b.fillText("\u5df2\u52a0\u8f7d" + Math.floor(100 * (a / e)) + "%", c / 2, d / 2 + 7),
  600. b.fill(),
  601. b.restore(),
  602. a == e && (clearInterval(this.loadTimer), b.clearRect(0, 0, c, d), this.init(), this.loadfuc())
  603. },
  604. gameStart: function() {
  605. this.stimer = this.requestAnimFrame(function() {
  606. this.gameStart()
  607. }.bind(this)),
  608. this.timeline && (this.tlinefuc(this.timeline), this.timeline++);
  609. var a = (new Date).getTime();
  610. this.__render(a - this.lastAnimationFrameTime),
  611. this.lastAnimationFrameTime = a
  612. },
  613. gameOver: function() {
  614. this.cancelAFrame(this.stimer)
  615. },
  616. ontimefuc: function(a) {
  617. this.timeline = 1,
  618. this.tlinefuc = a
  619. },
  620. offtimefuc: function() {
  621. this.timeline = 0
  622. },
  623. addEventListener: function(a) {
  624. function d(d) {
  625. if (eG.eventList[a]) {
  626. 1 == d.targetTouches.length && (d.preventDefault(), d = d.targetTouches[0]),
  627. "touchend" == a && (d = d.changedTouches[0]);
  628. for (var e = eG.eventList[a], f = 0, g = e.length, h = new b.OBB(new eG.Vector2(d.pageX * c.p_x, d.pageY * c.p_x + c.pos_y), 0, 0, 0); g > f; f++) {
  629. var i = e[f];
  630. if (eG.OBBvsOBB(h, i.testObb())) for (var j = 0,
  631. k = i.eventFuc[a].length; k > j; j++) i.eventFuc[a][j](d)
  632. }
  633. }
  634. }
  635. this.canvas.addEventListener(a, d);
  636. var c = this
  637. },
  638. __drawFPS: function(a) {
  639. var b = 1e3 / (a - this.lastAnimationFrameTime);
  640. this.lastAnimationFrameTime = a,
  641. a - this.lastFpsUpdateTime > 2e3 && (this.lastFpsUpdateTime = a, this._fps = b)
  642. },
  643. __render: function(a) {
  644. for (var b = 0,
  645. c = this.objList.length; c > b; b++) {
  646. for (var d = 0,
  647. e = 0,
  648. f = this.objList[b]; e < f.length; e++) f[e].die && f.splice(e, 1);
  649. for (var g = f.length; g > d; d++) {
  650. var h = f[d];
  651. h.static || (h.x += this.__viewport.speed_x * a, h.y += this.__viewport.speed_y * a),
  652. h.update(a),
  653. h.render(a)
  654. }
  655. }
  656. },
  657. __viewport: {
  658. speed_x: 0,
  659. speed_y: 0
  660. },
  661. setviewPort: function(a, b) {
  662. this.__viewport.speed_x = a || 0,
  663. this.__viewport.speed_y = b || 0
  664. },
  665. init: function() {
  666. this.lastAnimationFrameTime = (new Date).getTime(),
  667. this.lastFpsUpdateTime = 0,
  668. this.p_x = this.canWidth / document.documentElement.clientWidth,
  669. this.p_y = this.canHeight / document.documentElement.clientHeight,
  670. this.pos_y = Math.abs(this.canvas.offsetTop * this.p_x),
  671. this.requestAnimFrame = function() {
  672. var b, c = d.fps;
  673. return b = c ?
  674. function(b) {
  675. a.setTimeout(b, 1e3 / c)
  676. }: a.requestAnimationFrame || a.webkitRequestAnimationFrame || a.mozRequestAnimationFrame || a.oRequestAnimationFrame || a.msRequestAnimationFrame ||
  677. function(b) {
  678. a.setTimeout(b, 1e3 / 60)
  679. }
  680. }.bind(this)().bind(),
  681. this.cancelAFrame = function() {
  682. return a.cancelAnimationFrame || a.webkitCancelAnimationFrame || a.mozCancelAnimationFrame || a.oCancelAnimationFrame ||
  683. function(b) {
  684. a.clearTimeout(b)
  685. }
  686. } ().bind()
  687. }
  688. },
  689. c.extend = function() {
  690. var a, b, c, d, e = this;
  691. if (null != (a = arguments[0])) for (b in a) c = e[b],
  692. d = a[b],
  693. e !== d && (e[b] = d);
  694. return e
  695. },
  696. c
  697. };
  698. b.versions = function() {
  699. var a = navigator.userAgent;
  700. return navigator.appVersion,
  701. {
  702. trident: a.indexOf("Trident") > -1,
  703. presto: a.indexOf("Presto") > -1,
  704. webKit: a.indexOf("AppleWebKit") > -1,
  705. gecko: a.indexOf("Gecko") > -1 && -1 == a.indexOf("KHTML"),
  706. ios: !!a.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
  707. android: a.indexOf("Android") > -1 || a.indexOf("Linux") > -1,
  708. iPhone: a.indexOf("iPhone") > -1,
  709. iPad: a.indexOf("iPad") > -1,
  710. webApp: -1 == a.indexOf("Safari")
  711. }
  712. } (),
  713. b.inherit = function(a, b) {
  714. var c = new Function;
  715. c.prototype = b.prototype,
  716. a.prototype = new c,
  717. a.prototype.constructor = a,
  718. a.superclass = b.prototype,
  719. a.prototype.constructor == Object.prototype.constructor && (a.prototype.constructor = b)
  720. },
  721. b.extend = function(a, b) {
  722. var c;
  723. for (c in b) b.hasOwnProperty(c) && (a[c] = b[c]);
  724. return a
  725. },
  726. b.createSprite = function(a) {
  727. var c = function(c) {
  728. b.extend(this, a),
  729. b.Sprite.call(this, c)
  730. };
  731. return b.inherit(c, b.Sprite),
  732. c
  733. },
  734. b.createBitmap = function(a) {
  735. var c = function(c) {
  736. b.extend(this, a),
  737. b.Bitmap.call(this, c)
  738. };
  739. return b.inherit(c, b.Bitmap),
  740. c
  741. },
  742. b.eventList = {},
  743. b.DisplayObject = function(a) {
  744. this.x = 0,
  745. this.y = 0,
  746. this.width = 0,
  747. this.height = 0,
  748. this.alpha = 1,
  749. this.die = 0,
  750. this.rotation = 0,
  751. this.visible = 0,
  752. this.scaleX = 1,
  753. this.scaleY = 1,
  754. this.globalCompositeOperation = "",
  755. this.ctx = null,
  756. this.obb = [],
  757. this.eventFuc = {},
  758. this.static = 0,
  759. this.timeline = 0,
  760. this.ontween = 0,
  761. b.extend(this, a),
  762. this.__init()
  763. },
  764. b.DisplayObject.prototype = {
  765. __transform: function(a) {
  766. a.translate(this.x, this.y),
  767. this.alpha < 1 && (a.globalAlpha = this.alpha),
  768. this.rotation && a.rotate(this.rotation),
  769. (1 != this.scaleX || 1 != this.scaleY) && a.scale(this.scaleX, this.scaleY),
  770. this.globalCompositeOperation && (a.globalCompositeOperation = this.globalCompositeOperation)
  771. },
  772. render: function(a) {
  773. if (this.__tween(a), this.timeline++, !this.visible) {
  774. var b = this.ctx;
  775. b.save(),
  776. this.__transform(b),
  777. this.draw(b),
  778. b.restore()
  779. }
  780. },
  781. addEventListener: function(a, c) {
  782. b.eventList[a] || (b.eventList[a] = []),
  783. this.eventFuc[a] || (this.eventFuc[a] = []),
  784. b.eventList[a].push(this),
  785. this.eventFuc[a].push(c.bind(this))
  786. },
  787. removeEventListener: function(a) {
  788. b.eventList[a].splice(b.eventList[a].indexOf(this), 1),
  789. this.eventFuc[a] = []
  790. },
  791. testObb: function() {
  792. return new b.OBB(new b.Vector2(this.x - this.__obb_x, this.y - this.__obb_y), this.__w, this.__h, this.rotation)
  793. },
  794. __init: function() {
  795. this.__w = this.obb[2] - this.obb[0],
  796. this.__h = this.obb[3] - this.obb[1],
  797. this.__obb_x = this.width / 2 - this.obb[0] - this.__w / 2,
  798. this.__obb_y = this.height / 2 - this.obb[1] - this.__h / 2,
  799. this.w = this.width,
  800. this.h = this.height
  801. },
  802. setObb: function(a) {
  803. this.obb = a
  804. },
  805. checkBorder: function() {
  806. return b.OBBvsOBB(this.testObb(), new OBB(new b.Vector2(canvas_w / 2, canvas_h / 2), canvas_w, canvas_h, 0))
  807. },
  808. remove: function() {
  809. this.die = 1;
  810. for (var a in this.eventFuc) this.removeEventListener(a)
  811. },
  812. to: function(a, b, c, d, e, f) {
  813. this.duration = b,
  814. this.pattern = c || "Linear",
  815. this.ease = d || "easeIn",
  816. this.tween_obj = a,
  817. this.ontween = 1,
  818. this.current = 0,
  819. this.delaytime = e || 0,
  820. this.delaytime_t = 0,
  821. this.fuc = f || null,
  822. this.d_obj = {};
  823. for (i in a) this.d_obj[i] = this[i]
  824. },
  825. __tween: function(a) {
  826. if (this.ontween) if (this.delaytime_t >= this.delaytime) {
  827. this.current += a;
  828. for (i in this.tween_obj) this[i] = "Linear" == this.pattern ? b.Tween.Linear(this.current, this.d_obj[i], this.tween_obj[i] - this.d_obj[i], this.duration) : b.Tween[this.pattern][this.ease](this.current, this.d_obj[i], this.tween_obj[i] - this.d_obj[i], this.duration);
  829. if (this.current >= this.duration) {
  830. for (i in this.tween_obj) this[i] = this.tween_obj[i];
  831. this.ontween = 0,
  832. this.delaytime_t = 0,
  833. this.fuc && this.fuc()
  834. }
  835. } else this.delaytime_t += a
  836. }
  837. },
  838. b.Tween = {
  839. Linear: function(a, b, c, d) {
  840. return c * a / d + b
  841. },
  842. Quad: {
  843. easeIn: function(a, b, c, d) {
  844. return c * (a /= d) * a + b
  845. },
  846. easeOut: function(a, b, c, d) {
  847. return - c * (a /= d) * (a - 2) + b
  848. },
  849. easeInOut: function(a, b, c, d) {
  850. return (a /= d / 2) < 1 ? c / 2 * a * a + b: -c / 2 * (--a * (a - 2) - 1) + b
  851. }
  852. },
  853. Cubic: {
  854. easeIn: function(a, b, c, d) {
  855. return c * (a /= d) * a * a + b
  856. },
  857. easeOut: function(a, b, c, d) {
  858. return c * ((a = a / d - 1) * a * a + 1) + b
  859. },
  860. easeInOut: function(a, b, c, d) {
  861. return (a /= d / 2) < 1 ? c / 2 * a * a * a + b: c / 2 * ((a -= 2) * a * a + 2) + b
  862. }
  863. },
  864. Quart: {
  865. easeIn: function(a, b, c, d) {
  866. return c * (a /= d) * a * a * a + b
  867. },
  868. easeOut: function(a, b, c, d) {
  869. return - c * ((a = a / d - 1) * a * a * a - 1) + b
  870. },
  871. easeInOut: function(a, b, c, d) {
  872. return (a /= d / 2) < 1 ? c / 2 * a * a * a * a + b: -c / 2 * ((a -= 2) * a * a * a - 2) + b
  873. }
  874. },
  875. Quint: {
  876. easeIn: function(a, b, c, d) {
  877. return c * (a /= d) * a * a * a * a + b
  878. },
  879. easeOut: function(a, b, c, d) {
  880. return c * ((a = a / d - 1) * a * a * a * a + 1) + b
  881. },
  882. easeInOut: function(a, b, c, d) {
  883. return (a /= d / 2) < 1 ? c / 2 * a * a * a * a * a + b: c / 2 * ((a -= 2) * a * a * a * a + 2) + b
  884. }
  885. },
  886. Sine: {
  887. easeIn: function(a, b, c, d) {
  888. return - c * Math.cos(a / d * (Math.PI / 2)) + c + b
  889. },
  890. easeOut: function(a, b, c, d) {
  891. return c * Math.sin(a / d * (Math.PI / 2)) + b
  892. },
  893. easeInOut: function(a, b, c, d) {
  894. return - c / 2 * (Math.cos(Math.PI * a / d) - 1) + b
  895. }
  896. },
  897. Expo: {
  898. easeIn: function(a, b, c, d) {
  899. return 0 == a ? b: c * Math.pow(2, 10 * (a / d - 1)) + b
  900. },
  901. easeOut: function(a, b, c, d) {
  902. return a == d ? b + c: c * ( - Math.pow(2, -10 * a / d) + 1) + b
  903. },
  904. easeInOut: function(a, b, c, d) {
  905. return 0 == a ? b: a == d ? b + c: (a /= d / 2) < 1 ? c / 2 * Math.pow(2, 10 * (a - 1)) + b: c / 2 * ( - Math.pow(2, -10 * --a) + 2) + b
  906. }
  907. },
  908. Circ: {
  909. easeIn: function(a, b, c, d) {
  910. return - c * (Math.sqrt(1 - (a /= d) * a) - 1) + b
  911. },
  912. easeOut: function(a, b, c, d) {
  913. return c * Math.sqrt(1 - (a = a / d - 1) * a) + b
  914. },
  915. easeInOut: function(a, b, c, d) {
  916. return (a /= d / 2) < 1 ? -c / 2 * (Math.sqrt(1 - a * a) - 1) + b: c / 2 * (Math.sqrt(1 - (a -= 2) * a) + 1) + b
  917. }
  918. },
  919. Elastic: {
  920. easeIn: function(a, b, c, d, e, f) {
  921. if (0 == a) return b;
  922. if (1 == (a /= d)) return b + c;
  923. if (f || (f = .3 * d), !e || e < Math.abs(c)) {
  924. e = c;
  925. var g = f / 4
  926. } else var g = f / (2 * Math.PI) * Math.asin(c / e);
  927. return - (e * Math.pow(2, 10 * (a -= 1)) * Math.sin((a * d - g) * 2 * Math.PI / f)) + b
  928. },
  929. easeOut: function(a, b, c, d, e, f) {
  930. if (0 == a) return b;
  931. if (1 == (a /= d)) return b + c;
  932. if (f || (f = .3 * d), !e || e < Math.abs(c)) {
  933. e = c;
  934. var g = f / 4
  935. } else var g = f / (2 * Math.PI) * Math.asin(c / e);
  936. return e * Math.pow(2, -10 * a) * Math.sin((a * d - g) * 2 * Math.PI / f) + c + b
  937. },
  938. easeInOut: function(a, b, c, d, e, f) {
  939. if (0 == a) return b;
  940. if (2 == (a /= d / 2)) return b + c;
  941. if (f || (f = d * .3 * 1.5), !e || e < Math.abs(c)) {
  942. e = c;
  943. var g = f / 4
  944. } else var g = f / (2 * Math.PI) * Math.asin(c / e);
  945. return 1 > a ? -.5 * e * Math.pow(2, 10 * (a -= 1)) * Math.sin((a * d - g) * 2 * Math.PI / f) + b: .5 * e * Math.pow(2, -10 * (a -= 1)) * Math.sin((a * d - g) * 2 * Math.PI / f) + c + b
  946. }
  947. },
  948. Back: {
  949. easeIn: function(a, b, c, d, e) {
  950. return void 0 == e && (e = 1.70158),
  951. c * (a /= d) * a * ((e + 1) * a - e) + b
  952. },
  953. easeOut: function(a, b, c, d, e) {
  954. return void 0 == e && (e = 1.70158),
  955. c * ((a = a / d - 1) * a * ((e + 1) * a + e) + 1) + b
  956. },
  957. easeInOut: function(a, b, c, d, e) {
  958. return void 0 == e && (e = 1.70158),
  959. (a /= d / 2) < 1 ? c / 2 * a * a * (((e *= 1.525) + 1) * a - e) + b: c / 2 * ((a -= 2) * a * (((e *= 1.525) + 1) * a + e) + 2) + b
  960. }
  961. },
  962. Bounce: {
  963. easeIn: function(a, b, c, d) {
  964. return c - this.easeOut(d - a, 0, c, d) + b
  965. },
  966. easeOut: function(a, b, c, d) {
  967. return (a /= d) < 1 / 2.75 ? c * 7.5625 * a * a + b: 2 / 2.75 > a ? c * (7.5625 * (a -= 1.5 / 2.75) * a + .75) + b: 2.5 / 2.75 > a ? c * (7.5625 * (a -= 2.25 / 2.75) * a + .9375) + b: c * (7.5625 * (a -= 2.625 / 2.75) * a + .984375) + b
  968. },
  969. easeInOut: function(a, b, c, d) {
  970. return d / 2 > a ? .5 * this.easeIn(2 * a, 0, c, d) + b: .5 * this.easeOut(2 * a - d, 0, c, d) + .5 * c + b
  971. }
  972. }
  973. },
  974. b.Bitmap = function(a) {
  975. b.DisplayObject.call(this, a)
  976. },
  977. b.inherit(b.Bitmap, b.DisplayObject),
  978. b.Bitmap.prototype.draw = function(a) {
  979. a.drawImage(this.img, 0, 0, this.width, this.height, -this.w / 2, -this.h / 2, this.w, this.h)
  980. },
  981. b.Bitmap.prototype.update = function() {},
  982. b.Sprite = function(a) {
  983. this.anim = null,
  984. b.DisplayObject.call(this, a)
  985. },
  986. b.inherit(b.Sprite, b.DisplayObject),
  987. b.Sprite.prototype.draw = function(a) {
  988. a.drawImage(this.anim.img, this.anim.x, this.anim.y, this.width, this.height, -this.width / 2, -this.height / 2, this.width, this.height)
  989. },
  990. b.Sprite.prototype.setAnim = function(a) {
  991. this.anim = a
  992. },
  993. b.Animdata = function(a, b, c) {
  994. for (var d = [], e = a.height / b, f = a.width / c, g = 0; b > g; g++) for (var h = 0; c > h; h++) d.push([h * f, e * g]);
  995. return d
  996. },
  997. b.Animation = function(a) {
  998. this.ctx = null,
  999. this.img = null,
  1000. this.frames = [],
  1001. this.loop = 0,
  1002. this.speed = 1,
  1003. this.__speed_t = 0,
  1004. this.duration = 0,
  1005. this.frameIndex = 0,
  1006. this.onplay = 1,
  1007. b.extend(this, a),
  1008. this.len = this.frames.length
  1009. },
  1010. b.Animation.prototype = {
  1011. update: function(a) {
  1012. this.onplay && (this.__speed_t += a * this.speed, this.__speed_t >= this.duration && this.__nextFrame(Math.floor(this.__speed_t / this.duration)), this.x = this.frames[this.frameIndex][0], this.y = this.frames[this.frameIndex][1])
  1013. },
  1014. setEndfuc: function(a) {
  1015. this.endfuc = a
  1016. },
  1017. setSpeed: function(a) {
  1018. this.speed = a,
  1019. this.__speed_t = 0
  1020. },
  1021. stop: function() {
  1022. this.onplay = 0
  1023. },
  1024. play: function() {
  1025. this.onplay = 1
  1026. },
  1027. __nextFrame: function(a) {
  1028. this.frameIndex < this.len - a ? this.goframe(this.frameIndex + a) : this.loop ? this.goframe(0) : (this.endfuc && this.endfuc(), this.stop())
  1029. },
  1030. goframe: function(a) {
  1031. this.frameIndex = a,
  1032. this.__speed_t = 0
  1033. }
  1034. },
  1035. b.TextField = function(a) {
  1036. this.type = "text",
  1037. this.color = "#000",
  1038. this.size = "12px",
  1039. this.family = "Verdana",
  1040. this.text = "",
  1041. this.weight = "normal",
  1042. this.textAlign = "left",
  1043. b.DisplayObject.call(this, a)
  1044. },
  1045. b.inherit(b.TextField, b.DisplayObject),
  1046. b.TextField.prototype.draw = function(a) {
  1047. a.fillStyle = this.color,
  1048. a.shadowColor = "#000",
  1049. a.shadowOffsetX = 2,
  1050. a.shadowOffsetY = 2,
  1051. a.textAlign = this.textAlign,
  1052. a.font = this.weight + " " + this.size + "px " + this.family,
  1053. a.fillText(this.text, 0, 0),
  1054. a.fill()
  1055. },
  1056. b.TextField.prototype.update = function() {},
  1057. b.Math = {
  1058. random: function(a, b) {
  1059. return Math.floor(Math.random() * (b - a + 1) + a)
  1060. },
  1061. coordinate: function(a, b, c, d, e) {
  1062. var f = (a - c) * Math.cos(e),
  1063. g = (b - d) * Math.sin(e);
  1064. return [Math.round(f - g + c), Math.round(f + g + c)]
  1065. }
  1066. },
  1067. b.OBB = function(a, c, d, e) {
  1068. this.centerPoint = a,
  1069. this.extents = [c / 2, d / 2],
  1070. this.axes = [new b.Vector2(Math.cos(e), Math.sin(e)), new b.Vector2( - Math.sin(e), Math.cos(e))],
  1071. this._width = c,
  1072. this._height = d,
  1073. this._rotation = e
  1074. },
  1075. b.OBB.prototype.getRadius = function(a) {
  1076. return this.extents[0] * Math.abs(a.dot(this.axes[0])) + this.extents[1] * Math.abs(a.dot(this.axes[1]))
  1077. },
  1078. b.Vector2 = function(a, b) {
  1079. this.x = a || 0,
  1080. this.y = b || 0
  1081. },
  1082. b.Vector2.prototype = {
  1083. sub: function(a) {
  1084. return new b.Vector2(this.x - a.x, this.y - a.y)
  1085. },
  1086. dot: function(a) {
  1087. return this.x * a.x + this.y * a.y
  1088. }
  1089. },
  1090. b.OBBvsOBB = function(a, b) {
  1091. var c = a.centerPoint.sub(b.centerPoint),
  1092. d = a.axes[0],
  1093. e = a.axes[1],
  1094. f = b.axes[0],
  1095. g = b.axes[1];
  1096. return a.getRadius(g) + b.getRadius(g) <= Math.abs(c.dot(g)) || a.getRadius(f) + b.getRadius(f) <= Math.abs(c.dot(f)) || a.getRadius(e) + b.getRadius(e) <= Math.abs(c.dot(e)) || a.getRadius(d) + b.getRadius(d) <= Math.abs(c.dot(d)) ? 0 : 1
  1097. },
  1098. a.eG = a.easyGame = b
  1099. } (window);
  1100. var buzz = {
  1101. defaults: {
  1102. autoplay: !1,
  1103. duration: 5e3,
  1104. formats: [],
  1105. loop: !1,
  1106. placeholder: "--",
  1107. preload: "metadata",
  1108. volume: 80
  1109. },
  1110. types: {
  1111. mp3: "audio/mpeg",
  1112. ogg: "audio/ogg",
  1113. wav: "audio/wav",
  1114. aac: "audio/aac",
  1115. m4a: "audio/x-m4a"
  1116. },
  1117. sounds: [],
  1118. el: document.createElement("audio"),
  1119. sound: function(a, b) {
  1120. function c(a) {
  1121. for (var b = [], c = a.length - 1, d = 0; c >= d; d++) b.push({
  1122. start: a.start(c),
  1123. end: a.end(c)
  1124. });
  1125. return b
  1126. }
  1127. function d(a) {
  1128. return a.split(".").pop()
  1129. }
  1130. function e(a, b) {
  1131. var c = document.createElement("source");
  1132. c.src = b,
  1133. buzz.types[d(b)] && (c.type = buzz.types[d(b)]),
  1134. a.appendChild(c)
  1135. }
  1136. b = b || {};
  1137. var f = 0,
  1138. g = [],
  1139. h = {},
  1140. i = buzz.isSupported();
  1141. if (this.load = function() {
  1142. return i ? (this.sound.load(), this) : this
  1143. },
  1144. this.play = function() {
  1145. return i ? (this.sound.play(), this) : this
  1146. },
  1147. this.togglePlay = function() {
  1148. return i ? (this.sound.paused ? this.sound.play() : this.sound.pause(), this) : this
  1149. },
  1150. this.pause = function() {
  1151. return i ? (this.sound.pause(), this) : this
  1152. },
  1153. this.isPaused = function() {
  1154. return i ? this.sound.paused: null
  1155. },
  1156. this.stop = function() {
  1157. return i ? (this.setTime(this.getDuration()), this.sound.pause(), this) : this
  1158. },
  1159. this.isEnded = function() {
  1160. return i ? this.sound.ended: null
  1161. },
  1162. this.loop = function() {
  1163. return i ? (this.sound.loop = "loop", this.bind("ended.buzzloop",
  1164. function() {
  1165. this.currentTime = 0,
  1166. this.play()
  1167. }), this) : this
  1168. },
  1169. this.unloop = function() {
  1170. return i ? (this.sound.removeAttribute("loop"), this.unbind("ended.buzzloop"), this) : this
  1171. },
  1172. this.mute = function() {
  1173. return i ? (this.sound.muted = !0, this) : this
  1174. },
  1175. this.unmute = function() {
  1176. return i ? (this.sound.muted = !1, this) : this
  1177. },
  1178. this.toggleMute = function() {
  1179. return i ? (this.sound.muted = !this.sound.muted, this) : this
  1180. },
  1181. this.isMuted = function() {
  1182. return i ? this.sound.muted: null
  1183. },
  1184. this.setVolume = function(a) {
  1185. return i ? (0 > a && (a = 0), a > 100 && (a = 100), this.volume = a, this.sound.volume = a / 100, this) : this
  1186. },
  1187. this.getVolume = function() {
  1188. return i ? this.volume: this
  1189. },
  1190. this.increaseVolume = function(a) {
  1191. return this.setVolume(this.volume + (a || 1))
  1192. },
  1193. this.decreaseVolume = function(a) {
  1194. return this.setVolume(this.volume - (a || 1))
  1195. },
  1196. this.setTime = function(a) {
  1197. return i ? (this.whenReady(function() {
  1198. this.sound.currentTime = a
  1199. }), this) : this
  1200. },
  1201. this.getTime = function() {
  1202. if (!i) return null;
  1203. var a = Math.round(100 * this.sound.currentTime) / 100;
  1204. return isNaN(a) ? buzz.defaults.placeholder: a
  1205. },
  1206. this.setPercent = function(a) {
  1207. return i ? this.setTime(buzz.fromPercent(a, this.sound.duration)) : this
  1208. },
  1209. this.getPercent = function() {
  1210. if (!i) return null;
  1211. var a = Math.round(buzz.toPercent(this.sound.currentTime, this.sound.duration));
  1212. return isNaN(a) ? buzz.defaults.placeholder: a
  1213. },
  1214. this.setSpeed = function(a) {
  1215. return i ? (this.sound.playbackRate = a, void 0) : this
  1216. },
  1217. this.getSpeed = function() {
  1218. return i ? this.sound.playbackRate: null
  1219. },
  1220. this.getDuration = function() {
  1221. if (!i) return null;
  1222. var a = Math.round(100 * this.sound.duration) / 100;
  1223. return isNaN(a) ? buzz.defaults.placeholder: a
  1224. },
  1225. this.getPlayed = function() {
  1226. return i ? c(this.sound.played) : null
  1227. },
  1228. this.getBuffered = function() {
  1229. return i ? c(this.sound.buffered) : null
  1230. },
  1231. this.getSeekable = function() {
  1232. return i ? c(this.sound.seekable) : null
  1233. },
  1234. this.getErrorCode = function() {
  1235. return i && this.sound.error ? this.sound.error.code: 0
  1236. },
  1237. this.getErrorMessage = function() {
  1238. if (!i) return null;
  1239. switch (this.getErrorCode()) {
  1240. case 1:
  1241. return "MEDIA_ERR_ABORTED";
  1242. case 2:
  1243. return "MEDIA_ERR_NETWORK";
  1244. case 3:
  1245. return "MEDIA_ERR_DECODE";
  1246. case 4:
  1247. return "MEDIA_ERR_SRC_NOT_SUPPORTED";
  1248. default:
  1249. return null
  1250. }
  1251. },
  1252. this.getStateCode = function() {
  1253. return i ? this.sound.readyState: null
  1254. },
  1255. this.getStateMessage = function() {
  1256. if (!i) return null;
  1257. switch (this.getStateCode()) {
  1258. case 0:
  1259. return "HAVE_NOTHING";
  1260. case 1:
  1261. return "HAVE_METADATA";
  1262. case 2:
  1263. return "HAVE_CURRENT_DATA";
  1264. case 3:
  1265. return "HAVE_FUTURE_DATA";
  1266. case 4:
  1267. return "HAVE_ENOUGH_DATA";
  1268. default:
  1269. return null
  1270. }
  1271. },
  1272. this.getNetworkStateCode = function() {
  1273. return i ? this.sound.networkState: null
  1274. },
  1275. this.getNetworkStateMessage = function() {
  1276. if (!i) return null;
  1277. switch (this.getNetworkStateCode()) {
  1278. case 0:
  1279. return "NETWORK_EMPTY";
  1280. case 1:
  1281. return "NETWORK_IDLE";
  1282. case 2:
  1283. return "NETWORK_LOADING";
  1284. case 3:
  1285. return "NETWORK_NO_SOURCE";
  1286. default:
  1287. return null
  1288. }
  1289. },
  1290. this.set = function(a, b) {
  1291. return i ? (this.sound[a] = b, this) : this
  1292. },
  1293. this.get = function(a) {
  1294. return i ? a ? this.sound[a] : this.sound: null
  1295. },
  1296. this.bind = function(a, b) {
  1297. if (!i) return this;
  1298. a = a.split(" ");
  1299. for (var c = this,
  1300. d = function(a) {
  1301. b.call(c, a)
  1302. },
  1303. e = 0; e < a.length; e++) {
  1304. var f = a[e],
  1305. h = f;
  1306. f = h.split(".")[0],
  1307. g.push({
  1308. idx: h,
  1309. func: d
  1310. }),
  1311. this.sound.addEventListener(f, d, !0)
  1312. }
  1313. return this
  1314. },
  1315. this.unbind = function(a) {
  1316. if (!i) return this;
  1317. a = a.split(" ");
  1318. for (var b = 0; b < a.length; b++) for (var c = a[b], d = c.split(".")[0], e = 0; e < g.length; e++) {
  1319. var f = g[e].idx.split("."); (g[e].idx == c || f[1] && f[1] == c.replace(".", "")) && (this.sound.removeEventListener(d, g[e].func, !0), delete g[e])
  1320. }
  1321. return this
  1322. },
  1323. this.bindOnce = function(a, b) {
  1324. if (!i) return this;
  1325. var c = this;
  1326. h[f++] = !1,
  1327. this.bind(f + a,
  1328. function() {
  1329. h[f] || (h[f] = !0, b.call(c)),
  1330. c.unbind(f + a)
  1331. })
  1332. },
  1333. this.trigger = function(a) {
  1334. if (!i) return this;
  1335. a = a.split(" ");
  1336. for (var b = 0; b < a.length; b++) for (var c = a[b], d = 0; d < g.length; d++) {
  1337. var e = g[d].idx.split(".");
  1338. if (g[d].idx == c || e[0] && e[0] == c.replace(".", "")) {
  1339. var f = document.createEvent("HTMLEvents");
  1340. f.initEvent(e[0], !1, !0),
  1341. this.sound.dispatchEvent(f)
  1342. }
  1343. }
  1344. return this
  1345. },
  1346. this.fadeTo = function(a, b, c) {
  1347. function d() {
  1348. setTimeout(function() {
  1349. a > e && g.volume < a ? (g.setVolume(g.volume += 1), d()) : e > a && g.volume > a ? (g.setVolume(g.volume -= 1), d()) : c instanceof Function && c.apply(g)
  1350. },
  1351. f)
  1352. }
  1353. if (!i) return this;
  1354. b instanceof Function ? (c = b, b = buzz.defaults.duration) : b = b || buzz.defaults.duration;
  1355. var e = this.volume,
  1356. f = b / Math.abs(e - a),
  1357. g = this;
  1358. return this.play(),
  1359. this.whenReady(function() {
  1360. d()
  1361. }),
  1362. this
  1363. },
  1364. this.fadeIn = function(a, b) {
  1365. return i ? this.setVolume(0).fadeTo(100, a, b) : this
  1366. },
  1367. this.fadeOut = function(a, b) {
  1368. return i ? this.fadeTo(0, a, b) : this
  1369. },
  1370. this.fadeWith = function(a, b) {
  1371. return i ? (this.fadeOut(b,
  1372. function() {
  1373. this.stop()
  1374. }), a.play().fadeIn(b), this) : this
  1375. },
  1376. this.whenReady = function(a) {
  1377. if (!i) return null;
  1378. var b = this;
  1379. 0 === this.sound.readyState ? this.bind("canplay.buzzwhenready",
  1380. function() {
  1381. a.call(b)
  1382. }) : a.call(b)
  1383. },
  1384. i) {
  1385. for (var j in buzz.defaults) buzz.defaults.hasOwnProperty(j) && (b[j] = b[j] || buzz.defaults[j]);
  1386. if (this.sound = document.createElement("audio"), a instanceof Array) for (var k in a) a.hasOwnProperty(k) && e(this.sound, a[k]);
  1387. else if (b.formats.length) for (var l in b.formats) b.formats.hasOwnProperty(l) && e(this.sound, a + "." + b.formats[l]);
  1388. else e(this.sound, a);
  1389. b.loop && this.loop(),
  1390. b.autoplay && (this.sound.autoplay = "autoplay"),
  1391. this.sound.preload = b.preload === !0 ? "auto": b.preload === !1 ? "none": b.preload,
  1392. this.setVolume(b.volume),
  1393. buzz.sounds.push(this)
  1394. }
  1395. },
  1396. group: function(a) {
  1397. function b() {
  1398. for (var b = c(null, arguments), d = b.shift(), e = 0; e < a.length; e++) a[e][d].apply(a[e], b)
  1399. }
  1400. function c(a, b) {
  1401. return a instanceof Array ? a: Array.prototype.slice.call(b)
  1402. }
  1403. a = c(a, arguments),
  1404. this.getSounds = function() {
  1405. return a
  1406. },
  1407. this.add = function(b) {
  1408. b = c(b, arguments);
  1409. for (var d = 0; d < b.length; d++) a.push(b[d])
  1410. },
  1411. this.remove = function(b) {
  1412. b = c(b, arguments);
  1413. for (var d = 0; d < b.length; d++) for (var e = 0; e < a.length; e++) if (a[e] == b[d]) {
  1414. delete a[e];
  1415. break
  1416. }
  1417. },
  1418. this.load = function() {
  1419. return b("load"),
  1420. this
  1421. },
  1422. this.play = function() {
  1423. return b("play"),
  1424. this
  1425. },
  1426. this.togglePlay = function() {
  1427. return b("togglePlay"),
  1428. this
  1429. },
  1430. this.pause = function(a) {
  1431. return b("pause", a),
  1432. this
  1433. },
  1434. this.stop = function() {
  1435. return b("stop"),
  1436. this
  1437. },
  1438. this.mute = function() {
  1439. return b("mute"),
  1440. this
  1441. },
  1442. this.unmute = function() {
  1443. return b("unmute"),
  1444. this
  1445. },
  1446. this.toggleMute = function() {
  1447. return b("toggleMute"),
  1448. this
  1449. },
  1450. this.setVolume = function(a) {
  1451. return b("setVolume", a),
  1452. this
  1453. },
  1454. this.increaseVolume = function(a) {
  1455. return b("increaseVolume", a),
  1456. this
  1457. },
  1458. this.decreaseVolume = function(a) {
  1459. return b("decreaseVolume", a),
  1460. this
  1461. },
  1462. this.loop = function() {
  1463. return b("loop"),
  1464. this
  1465. },
  1466. this.unloop = function() {
  1467. return b("unloop"),
  1468. this
  1469. },
  1470. this.setTime = function(a) {
  1471. return b("setTime", a),
  1472. this
  1473. },
  1474. this.setduration = function(a) {
  1475. return b("setduration", a),
  1476. this
  1477. },
  1478. this.set = function(a, c) {
  1479. return b("set", a, c),
  1480. this
  1481. },
  1482. this.bind = function(a, c) {
  1483. return b("bind", a, c),
  1484. this
  1485. },
  1486. this.unbind = function(a) {
  1487. return b("unbind", a),
  1488. this
  1489. },
  1490. this.bindOnce = function(a, c) {
  1491. return b("bindOnce", a, c),
  1492. this
  1493. },
  1494. this.trigger = function(a) {
  1495. return b("trigger", a),
  1496. this
  1497. },
  1498. this.fade = function(a, c, d, e) {
  1499. return b("fade", a, c, d, e),
  1500. this
  1501. },
  1502. this.fadeIn = function(a, c) {
  1503. return b("fadeIn", a, c),
  1504. this
  1505. },
  1506. this.fadeOut = function(a, c) {
  1507. return b("fadeOut", a, c),
  1508. this
  1509. }
  1510. },
  1511. all: function() {
  1512. return new buzz.group(buzz.sounds)
  1513. },
  1514. isSupported: function() {
  1515. return !! buzz.el.canPlayType
  1516. },
  1517. isOGGSupported: function() {
  1518. return !! buzz.el.canPlayType && buzz.el.canPlayType('audio/ogg; codecs="vorbis"')
  1519. },
  1520. isWAVSupported: function() {
  1521. return !! buzz.el.canPlayType && buzz.el.canPlayType('audio/wav; codecs="1"')
  1522. },
  1523. isMP3Supported: function() {
  1524. return !! buzz.el.canPlayType && buzz.el.canPlayType("audio/mpeg;")
  1525. },
  1526. isAACSupported: function() {
  1527. return !! buzz.el.canPlayType && (buzz.el.canPlayType("audio/x-m4a;") || buzz.el.canPlayType("audio/aac;"))
  1528. },
  1529. toTimer: function(a, b) {
  1530. var c, d, e;
  1531. return c = Math.floor(a / 3600),
  1532. c = isNaN(c) ? "--": c >= 10 ? c: "0" + c,
  1533. d = b ? Math.floor(a / 60 % 60) : Math.floor(a / 60),
  1534. d = isNaN(d) ? "--": d >= 10 ? d: "0" + d,
  1535. e = Math.floor(a % 60),
  1536. e = isNaN(e) ? "--": e >= 10 ? e: "0" + e,
  1537. b ? c + ":" + d + ":" + e: d + ":" + e
  1538. },
  1539. fromTimer: function(a) {
  1540. var b = a.toString().split(":");
  1541. return b && 3 == b.length && (a = 3600 * parseInt(b[0], 10) + 60 * parseInt(b[1], 10) + parseInt(b[2], 10)),
  1542. b && 2 == b.length && (a = 60 * parseInt(b[0], 10) + parseInt(b[1], 10)),
  1543. a
  1544. },
  1545. toPercent: function(a, b, c) {
  1546. var d = Math.pow(10, c || 0);
  1547. return Math.round(100 * a / b * d) / d
  1548. },
  1549. fromPercent: function(a, b, c) {
  1550. var d = Math.pow(10, c || 0);
  1551. return Math.round(b / 100 * a * d) / d
  1552. }
  1553. },
  1554. game = function(a) {
  1555. this.over_t = 0,
  1556. this.onStart = 0,
  1557. this.bzlist = [],
  1558. this.splist = [],
  1559. this.enemylist = [],
  1560. this.tanklist = [],
  1561. this.stage = null,
  1562. this.s = [],
  1563. this.s2 = [],
  1564. this.drPd = [],
  1565. this.drJg = [],
  1566. this.drDpd = [],
  1567. this.splist = [],
  1568. this.chenaList = [],
  1569. this.zd = "a",
  1570. this.player = null,
  1571. this.stimer = null,
  1572. this.sL = 0,
  1573. this.gd = 0,
  1574. this.lastAnimationFrameTime = 0,
  1575. this.lastFpsUpdateTime = 0,
  1576. this.fps = 0,
  1577. this.leg = 0,
  1578. this.c = a,
  1579. this.st = 0,
  1580. this.t = 0,
  1581. IsPC() ? (gameEnter.style.width = "320px", this.pos_y = a.height, this.p_x = 1) : (this.p_x = this.c.width / document.documentElement.clientWidth, this.pos_y = document.documentElement.clientHeight * this.p_x, a.height = this.pos_y),
  1582. this._x = 230,
  1583. this._y = 440,
  1584. this.easyGameList = [],
  1585. this.ctx2 = a.getContext("2d"),
  1586. this.ctx3 = score.getContext("2d"),
  1587. this.ctx4 = hit.getContext("2d"),
  1588. this.mub_list = [null, null, null, null, null, null, null, null, null],
  1589. this.all_mub = "000000000",
  1590. this.hit_list = [null, null, null],
  1591. this.hit_mub = "000",
  1592. this.imgList = ["img/startbg.jpg", "img/startBtn.png", "img/dr1.png", "img/pt.png", "img/dr2.png", "img/fire2.png", "img/pd.png", "img/pd2.png", "img/lxj.png", "img/dr8.png", "img/pd4.png", "img/pd3.png", "img/pd10.png", "img/pd8.png", "img/logo.png", "img/dr4.png", "img/hit.png", "img/bz3.png", "img/fire.png", "img/pd2.png", "img/pd11.png", "img/over.png", "img/restart.png", "img/pd6.png", "img/dr5.png", "img/dr6.png", "img/pd4.png", "img/hero.png", "img/s1.png", "img/s2.png", "img/s3.png", "img/share.png", "img/bg6.jpg", "img/dr6.png", "img/pd7.png", "img/pd8.png", "img/pd9.png", "img/pd10.png", "img/bz4.png", "img/dr5.png", "img/pd12.png", "img/pd5.png", "img/bz2.png", "img/jn2.png", "img/lxj2.png", "img/pd7.png", "img/dr10.png", "img/chena1.png", "img/pt2.png", "img/dr3.png", "img/chena2.png", "img/dr7.png", "img/lxj3.png", "img/pd22.png", "img/fire3.png", "img/dr9.png", "img/pd13.png", "img/pd14.png", "img/dr10.png", "img/pt3.png", "img/chena3.png", "img/lxj4.png", "img/fire4.png", "img/plane2.png", "img/fx.png", "img/plane3.png", "img/pd15.png", "img/pd17.png", "img/pd16.png", "img/pd19.png", "img/pd20.png", "img/pd21.png", "img/dr11.png", "img/pt4.png", "img/pt5.png", "img/p2.jpg", "img/power.png", "img/bg5.jpg", "img/hp.png", "img/pt6.png", "img/mis.png", "img/m1.png", "img/pd24.png", "img/pd25.png", "img/m2.png", "img/mu0.png", "img/mu1.png", "img/mu2.png", "img/mu3.png", "img/mu4.png", "img/mu5.png", "img/mu6.png", "img/mu7.png", "img/mu8.png", "img/mu9.png", "img/pt12.png", "img/pt13.png", "img/pt14.png", "img/pt15.png", "img/pt10.png", "img/pt11.png", "img/pd26.png", "img/pd27.png", "img/pd28.png", "img/pd29.png", "img/pd30.png", "img/pd31.png", "img/p4.jpg", "img/cop.png", "img/next.png", "img/ct.png"],
  1593. this.imgDx = [];
  1594. for (var c = 0; c < this.imgList.length; c++) this.imgDx[c] = new Image,
  1595. this.imgDx[c].src = this.imgList[c]
  1596. };
  1597. game.prototype.addEventListener = function(a) {
  1598. function c(c) {
  1599. if ("touchstart" == a && eG.eventList[a]) {
  1600. "touchstart" == a && 1 == c.targetTouches.length && (c.preventDefault(), c = c.targetTouches[0]),
  1601. "touchend" == a && (c = c.changedTouches[0]);
  1602. for (var d = eG.eventList[a], e = 0, f = d.length, g = new easyGame.OBB(new eG.Vector2(c.pageX * b.p_x, c.pageY * b.p_x), 0, 0, 0); f > e; e++) {
  1603. var h = d[e];
  1604. if (eG.OBBvsOBB(g, h.testObb())) for (var i = 0,
  1605. j = h.eventFuc[a].length; j > i; i++) h.eventFuc[a][i](c)
  1606. }
  1607. }
  1608. if ("click" == a && eG.eventList.touchstart) {
  1609. "touchstart" == a && 1 == c.targetTouches.length && (c.preventDefault(), c = c.targetTouches[0]),
  1610. "touchend" == a && (c = c.changedTouches[0]);
  1611. for (var d = eG.eventList.touchstart,
  1612. e = 0,
  1613. f = d.length,
  1614. g = new easyGame.OBB(new eG.Vector2(c.pageX * b.p_x, c.pageY * b.p_x), 0, 0, 0); f > e; e++) {
  1615. var h = d[e];
  1616. if (eG.OBBvsOBB(g, h.testObb())) for (var i = 0,
  1617. j = h.eventFuc.touchstart.length; j > i; i++) h.eventFuc.touchstart[i](c)
  1618. }
  1619. }
  1620. }
  1621. this.c.addEventListener(a, c);
  1622. var b = this
  1623. },
  1624. game.prototype.drawFPS = function(a) {
  1625. var b = 1e3 / (a - this.lastAnimationFrameTime);
  1626. this.lastAnimationFrameTime = a,
  1627. a - this.lastFpsUpdateTime > 1e3 && (this.lastFpsUpdateTime = a, this.fps = b),
  1628. this.ctx2.font = "18px Arial bold",
  1629. this.ctx2.fillText(this.fps.toFixed(0) + "FPS", 10, 626)
  1630. },
  1631. game.prototype.score_init = function(a) {
  1632. for (var b = "",
  1633. c = 0; c < this.mub_list.length - a.toString().length; c++) b += " ";
  1634. a = b + a;
  1635. for (var d = a.toString().split(""), e = Attack.all_mub.toString().split(""), c = 0; c < Attack.mub_list.length; c++)" " != d[c] && (" " == e[c] && (e[c] = "0"), Attack.mub_list[c] = new a_mub(parseInt(e[c]), 14 * c + 3, parseInt(d[c]), 4, 28, this.ctx3));
  1636. Attack.all_mub = a.toString()
  1637. },
  1638. game.prototype.hit_init = function(a) {
  1639. for (var b = "",
  1640. c = 0; c < this.hit_list.length - a.toString().length; c++) b += " ";
  1641. a = b + a;
  1642. var d = a.toString().split(""),
  1643. e = Attack.hit_mub.toString().split("");
  1644. Attack.hit_mub = a.toString();
  1645. for (var c = 0; c < Attack.hit_list.length; c++)" " != d[c] && (" " == e[c] && (e[c] = "0"), Attack.hit_list[c] = new a_mub(parseInt(e[c]), 36 * c - 36, parseInt(d[c]), 5, 74, this.ctx4))
  1646. },
  1647. game.prototype.loading = function() {
  1648. this.stimer = setInterval(function() {
  1649. this.ready()
  1650. }.bind(this), 100)
  1651. },
  1652. game.prototype.ready = function() {
  1653. for (var a = 0,
  1654. b = 0; b < this.imgList.length; b++) this.imgDx[b].complete && a++;
  1655. var c = this.ctx2;
  1656. if (this.imgList.length, c.beginPath(), c.fillStyle = "#000", c.fillRect(0, 0, 320, 600), c.beginPath(), c.fillStyle = "#fff", c.font = "bold 19px Arial", c.textAlign = "center", c.fillText("LOADING... " + Math.floor(100 * (a / this.imgList.length)) + "%", 160, this.pos_y / 2), c.fill(), this.t++, a == this.imgList.length) {
  1657. clearInterval(this.stimer),
  1658. this.stimer3 = setInterval(function() {
  1659. this.ui()
  1660. }.bind(this), 20),
  1661. c.clearRect(0, 0, 320, 600);
  1662. var e = this.createrBtn(Attack.imgDx[0], 160, 285, 1),
  1663. f = this.createrBtn(Attack.imgDx[1], 160, this.pos_y + 100, 0),
  1664. g = this.createrBtn(Attack.imgDx[1], 160, this.pos_y + 100, 1);
  1665. f.update = function() {
  1666. this.ct++,
  1667. f.alpha = 1 - .3 * Math.sin(this.ct % 30 * Math.PI / 30)
  1668. },
  1669. f.to({
  1670. y: Attack.pos_y - 100
  1671. },
  1672. 30, "Back", "easeOut", 6),
  1673. g.to({
  1674. y: Attack.pos_y - 100
  1675. },
  1676. 30, "Back", "easeOut", 6);
  1677. var h = this.createrBtn(Attack.imgDx[14], 160, -100, 1);
  1678. h.to({
  1679. y: 120
  1680. },
  1681. 30, "Bounce", "easeOut", 0,
  1682. function() {
  1683. h.update = function() {
  1684. this.ct++,
  1685. h.alpha = 1 - .2 * Math.sin(this.ct % 50 * Math.PI / 50)
  1686. }
  1687. });
  1688. var i = this.createrBtn(Attack.imgDx[75], 153, 120, 0);
  1689. return i.update = function() {
  1690. if (this.ct++, this.ct % 180 >= 150) {
  1691. this.alpha = 1;
  1692. var b = Math.sin((this.ct % 180 - 150) * Math.PI / 30);
  1693. this.w = this.h = 110 * b,
  1694. this.rotation += Math.PI / 20
  1695. } else this.alpha = 0
  1696. },
  1697. this.easyGameList.push(e, g, f, h, i),
  1698. this.addEventListener("touchstart"),
  1699. this.addEventListener("click"),
  1700. f.addEventListener("touchstart",
  1701. function() {
  1702. g.to({
  1703. y: Attack.pos_y + 100
  1704. },
  1705. 10, "Back", "easeIn", 2),
  1706. f.to({
  1707. y: Attack.pos_y + 100
  1708. },
  1709. 10, "Back", "easeIn", 2,
  1710. function() {
  1711. Attack.onStart = 1,
  1712. Attack.easyGameList = [],
  1713. easyGame.eventList = {}
  1714. })
  1715. }),
  1716. void 0
  1717. }
  1718. },
  1719. game.prototype.createrBtn = function(a, b, c, d) {
  1720. var f, e = a.width,
  1721. g = a.height;
  1722. f = d ? "": "lighter";
  1723. var h = new easyGame.Bitmap({
  1724. ctx: Attack.ctx2,
  1725. img: a,
  1726. globalCompositeOperation: f,
  1727. width: e,
  1728. height: g,
  1729. "static": 1,
  1730. x: b,
  1731. alpha: 1,
  1732. ct: 0,
  1733. y: c,
  1734. ct: 0,
  1735. obb: [0, 0, e, g]
  1736. });
  1737. return h
  1738. },
  1739. game.prototype.ui = function() {
  1740. for (var a = 0,
  1741. b = 0,
  1742. c = 1,
  1743. d = this.easyGameList; b < d.length; b++) d[b].die && d.splice(b, 1);
  1744. for (var e = d.length; e > a; a++) {
  1745. var f = d[a];
  1746. f.static || (f.x += this.__viewport.speed_x * c, f.y += this.__viewport.speed_y * c),
  1747. f.update(c),
  1748. f.render(c)
  1749. }
  1750. this.onStart && (clearInterval(this.stimer3), setTimeout(function() {
  1751. this.start()
  1752. }.bind(this), 100))
  1753. },
  1754. game.prototype.information = function() {
  1755. var a = this.ctx2,
  1756. b = this.player;
  1757. a.drawImage(score, 120, 4),
  1758. a.save(),
  1759. a.globalCompositeOperation = "lighter",
  1760. a.drawImage(hit, 5, 55),
  1761. a.restore(),
  1762. this.ctx3.clearRect(0, 0, 144, 30),
  1763. this.ctx4.clearRect(0, 0, 160, 74),
  1764. b.htime > 0 && b.hit >= 1 ? (a.save(), b.htime--, a.globalCompositeOperation = "lighter", a.drawImage(Attack.imgDx[16], 102, 90), a.restore()) : (b.hit > b.maxHit && (b.maxHit = b.hit), this.hit_mub = "0000", b.hit = 0, this.hit_list = [null, null, null, null])
  1765. },
  1766. game.prototype.drObj = function() {
  1767. this.stimer = requestAnimFrame(function() {
  1768. Attack.drObj()
  1769. });
  1770. for (var a = this.enemylist,
  1771. b = this.tanklist,
  1772. c = this.bzlist,
  1773. d = this.splist,
  1774. e = this.drPd,
  1775. f = this.drDpd,
  1776. g = this.player,
  1777. h = this.s2,
  1778. i = 0; i < c.length; i++) c[i].die && c.splice(i, 1);
  1779. for (var i = 0; i < d.length; i++) d[i].die && d.splice(i, 1);
  1780. for (var i = 0; i < h.length; i++) h[i].die && h.splice(i, 1);
  1781. for (var i = 0; i < a.length; i++) a[i].die && a.splice(i, 1);
  1782. for (var i = 0; i < b.length; i++) b[i].die && b.splice(i, 1);
  1783. for (var i = 0; i < f.length; i++) f[i].die && f.splice(i, 1);
  1784. for (var i = 0; i < e.length; i++) e[i].die && e.splice(i, 1);
  1785. this.stage.drBg(),
  1786. this.stage.sT();
  1787. for (var i = 0; i < b.length; i++) b[i].move(),
  1788. b[i].check() && (b[i].dr(), b[i].fpao());
  1789. for (var i = 0; i < a.length; i++) a[i].move(),
  1790. a[i].check() && (a[i].dr(), a[i].fpao());
  1791. for (var i = 0; i < c.length; i++) c[i].dr(),
  1792. c[i].bao();
  1793. for (var i = 0; i < d.length; i++) d[i].dr(),
  1794. d[i].bao();
  1795. for (var i = 0; i < h.length; i++) h[i].dr(),
  1796. h[i].move();
  1797. for (var i = 0,
  1798. j = e.length; j > i; i++) e[i].move2(),
  1799. e[i].dr();
  1800. for (var i = 0,
  1801. j = f.length; j > i; i++) f[i].move(),
  1802. f[i].dr();
  1803. if (!g.die) {
  1804. g.moveZd(),
  1805. g.dr(),
  1806. g.fpao();
  1807. for (var i = 0; 4 > i; i++) null != Attack.hit_list[i] && (Attack.hit_list[i].dr(), Attack.hit_list[i].move());
  1808. this.information();
  1809. for (var i = 0; 9 > i; i++) null != Attack.mub_list[i] && (Attack.mub_list[i].dr(), Attack.mub_list[i].move())
  1810. }
  1811. "a" != this.zd && (this.zd.dr(), this.zd.run());
  1812. for (var j = 0,
  1813. k = 0,
  1814. l = 1,
  1815. m = this.easyGameList; k < m.length; k++) m[k].die && m.splice(k, 1);
  1816. for (var n = m.length; n > j; j++) {
  1817. var o = m[j];
  1818. o.static || (o.x += this.__viewport.speed_x * l, o.y += this.__viewport.speed_y * l),
  1819. o.update(l),
  1820. o.render(l)
  1821. }
  1822. },
  1823. game.prototype.gameover = function() {
  1824. var a = this.createrBtn(Attack.imgDx[21], 160, -100, 0);
  1825. a.to({
  1826. y: Attack.pos_y / 2 - 120
  1827. },
  1828. 30, "Bounce", "easeOut", 0);
  1829. var b = this.createrBtn(Attack.imgDx[22], -160, this.pos_y - 130, 0);
  1830. b.update = function() {
  1831. this.ct++,
  1832. b.alpha = 1 - .3 * Math.sin(this.ct % 30 * Math.PI / 30)
  1833. },
  1834. b.to({
  1835. x: 160
  1836. },
  1837. 30, "Back", "easeOut", 6),
  1838. b.addEventListener("touchstart",
  1839. function() {
  1840. Attack.init(),
  1841. Attack.restart()
  1842. });
  1843. var m = this.createrBtn(Attack.imgDx[31], -160, this.pos_y - 60, 0);
  1844. m.update = function() {
  1845. this.ct++,
  1846. m.alpha = 1 - .3 * Math.sin(this.ct % 30 * Math.PI / 30)
  1847. },
  1848. m.to({
  1849. x: 160
  1850. },
  1851. 30, "Back", "easeOut", 6),
  1852. m.addEventListener("touchstart",
  1853. function() {
  1854. dp_share();
  1855. }),
  1856. this.fxBox = new easyGame.Bitmap({
  1857. x: 160,
  1858. y: 290,
  1859. "static": 1,
  1860. img: Attack.imgDx[64],
  1861. width: 320,
  1862. height: 587,
  1863. alpha: 1,
  1864. ctx: Attack.ctx2
  1865. });
  1866. var c = new easyGame.TextField({
  1867. x: 150,
  1868. y: Attack.pos_y / 2,
  1869. text: "BREAK UP :",
  1870. "static": 1,
  1871. color: "#fff",
  1872. weight: "bold",
  1873. alpha: 0,
  1874. ctx: Attack.ctx2,
  1875. n: 0,
  1876. size: 16,
  1877. textAlign: "right"
  1878. });
  1879. c.to({
  1880. alpha: 1
  1881. },
  1882. 20, "Linear", "easeOut", 20);
  1883. var d = new easyGame.TextField({
  1884. x: 170,
  1885. y: Attack.pos_y / 2,
  1886. text: 0,
  1887. "static": 1,
  1888. alpha: 0,
  1889. color: "#fff",
  1890. weight: "bold",
  1891. ctx: Attack.ctx2,
  1892. n: 0,
  1893. size: 20,
  1894. textAlign: "left"
  1895. });
  1896. d.to({
  1897. alpha: 1
  1898. },
  1899. 20, "Linear", "easeOut", 20,
  1900. function() {
  1901. d.update = function() {
  1902. //this.n <= Attack.player.kill && (this.n += Attack.player.kill / 20, this.text = this.n.toFixed(0))
  1903. this.text=Attack.player.kill;
  1904. }
  1905. });
  1906. var e = new easyGame.TextField({
  1907. x: 150,
  1908. y: Attack.pos_y / 2 - 40,
  1909. text: "MAX-HIT :",
  1910. "static": 1,
  1911. color: "#fff",
  1912. weight: "bold",
  1913. ctx: Attack.ctx2,
  1914. n: 0,
  1915. alpha: 0,
  1916. size: 16,
  1917. textAlign: "right"
  1918. });
  1919. e.to({
  1920. alpha: 1
  1921. },
  1922. 20, "Linear", "easeOut", 0);
  1923. var f = new easyGame.TextField({
  1924. x: 170,
  1925. y: Attack.pos_y / 2 - 40,
  1926. text: 0,
  1927. "static": 1,
  1928. alpha: 0,
  1929. color: "#fff",
  1930. weight: "bold",
  1931. ctx: Attack.ctx2,
  1932. n: 0,
  1933. size: 20,
  1934. textAlign: "left"
  1935. });
  1936. f.to({
  1937. alpha: 1
  1938. },
  1939. 20, "Linear", "easeOut", 0,
  1940. function() {
  1941. f.update = function() {
  1942. // this.n <= Attack.player.maxHit && (this.n += Attack.player.maxHit / 20, this.text = this.n.toFixed(0))
  1943. this.text=Attack.player.maxHit;
  1944. }
  1945. });
  1946. var g = new easyGame.TextField({
  1947. x: 150,
  1948. y: Attack.pos_y / 2 + 40,
  1949. text: "SCORE :",
  1950. "static": 1,
  1951. alpha: 0,
  1952. color: "#fff",
  1953. weight: "bold",
  1954. ctx: Attack.ctx2,
  1955. n: 0,
  1956. size: 16,
  1957. textAlign: "right"
  1958. });
  1959. g.to({
  1960. alpha: 1
  1961. },
  1962. 20, "Linear", "easeOut", 40);
  1963. var h = new easyGame.TextField({
  1964. x: 170,
  1965. y: Attack.pos_y / 2 + 40,
  1966. text: 0,
  1967. "static": 1,
  1968. alpha: 0,
  1969. color: "#fff",
  1970. weight: "bold",
  1971. ctx: Attack.ctx2,
  1972. n: 0,
  1973. size: 20,
  1974. textAlign: "left"
  1975. });
  1976. h.to({
  1977. alpha: 1
  1978. },
  1979. 20, "Linear", "easeOut", 40,
  1980. function() {
  1981. h.update = function() {
  1982. // this.n <= parseInt(Attack.all_mub) && (this.n += parseInt(Attack.all_mub) / 20, this.text = this.n.toFixed(0))
  1983. this.text=parseInt(Attack.all_mub);
  1984. }
  1985. }),
  1986. this.easyGameList.push(this.fxBox, a, b, e, f, c, d, g, h,m);
  1987. dp_submitScore(parseInt(Attack.all_mub));
  1988. },
  1989. game.prototype.getItext = function(){
  1990. return "我击破"+Attack.player.kill+"架机体,最高连击数为"+Attack.player.maxHit+"最终得分"+parseInt(Attack.all_mub)+"快来挑战我吧!!!"
  1991. },
  1992. game.prototype.result = function() {
  1993. var a = this.createrBtn(Attack.imgDx[108], 160, -100, 0);
  1994. if (a.to({
  1995. y: Attack.pos_y / 2 - 120
  1996. },
  1997. 30, "Bounce", "easeOut", 0), this.stageI <= 0) {
  1998. var b = this.createrBtn(Attack.imgDx[109], -160, this.pos_y - 90, 0);
  1999. b.update = function() {
  2000. this.ct++,
  2001. b.alpha = 1 - .3 * Math.sin(this.ct % 30 * Math.PI / 30)
  2002. },
  2003. b.to({
  2004. x: 160
  2005. },
  2006. 30, "Back", "easeOut", 6),
  2007. b.addEventListener("touchstart",
  2008. function() {
  2009. a.to({
  2010. x: -160
  2011. },
  2012. 30, "Back", "easeOut", 0),
  2013. b.to({
  2014. x: 480
  2015. },
  2016. 30, "Back", "easeOut", 6),
  2017. Attack.fxBox.to({
  2018. alpha: 0
  2019. },
  2020. 20, "Linear", "easeIn", 5,
  2021. function() {
  2022. Attack.init(),
  2023. Attack.next()
  2024. })
  2025. })
  2026. } else {
  2027. var b = this.createrBtn(Attack.imgDx[110], -160, this.pos_y - 90, 0);
  2028. b.update = function() {
  2029. this.ct++,
  2030. b.alpha = 1 - .3 * Math.sin(this.ct % 30 * Math.PI / 30)
  2031. },
  2032. b.to({
  2033. x: 160
  2034. },
  2035. 30, "Back", "easeOut", 6),
  2036. b.addEventListener("touchstart",
  2037. function() {
  2038. a.to({
  2039. x: -160
  2040. },
  2041. 30, "Back", "easeOut", 0),
  2042. b.to({
  2043. x: 480
  2044. },
  2045. 30, "Back", "easeOut", 6),
  2046. Attack.fxBox.to({
  2047. alpha: 0
  2048. },
  2049. 20, "Linear", "easeIn", 5,
  2050. function() {
  2051. Attack.init(),
  2052. Attack.stageI = 0,
  2053. Attack.player.kill > 300 && Attack.player.maxHit > 100 && 100 * Math.random() < 12 && (Attack.gd = 1),
  2054. Attack.restart()
  2055. })
  2056. })
  2057. }
  2058. this.fxBox = new easyGame.Bitmap({
  2059. x: 160,
  2060. y: 290,
  2061. "static": 1,
  2062. img: Attack.imgDx[64],
  2063. width: 320,
  2064. height: 587,
  2065. alpha: 1,
  2066. ctx: Attack.ctx2
  2067. });
  2068. var c = new easyGame.TextField({
  2069. x: 150,
  2070. y: Attack.pos_y / 2,
  2071. text: "BREAK UP :",
  2072. "static": 1,
  2073. color: "#fff",
  2074. weight: "bold",
  2075. alpha: 0,
  2076. ctx: Attack.ctx2,
  2077. n: 0,
  2078. size: 16,
  2079. textAlign: "right"
  2080. });
  2081. c.to({
  2082. alpha: 1
  2083. },
  2084. 20, "Linear", "easeOut", 20);
  2085. var d = new easyGame.TextField({
  2086. x: 170,
  2087. y: Attack.pos_y / 2,
  2088. text: 0,
  2089. "static": 1,
  2090. alpha: 0,
  2091. color: "#fff",
  2092. weight: "bold",
  2093. ctx: Attack.ctx2,
  2094. n: 0,
  2095. size: 20,
  2096. textAlign: "left"
  2097. });
  2098. d.to({
  2099. alpha: 1
  2100. },
  2101. 20, "Linear", "easeOut", 20,
  2102. function() {
  2103. d.update = function() {
  2104. this.n <= Attack.player.kill && (this.n += Attack.player.kill / 20, this.text = this.n.toFixed(0))
  2105. }
  2106. });
  2107. var e = new easyGame.TextField({
  2108. x: 150,
  2109. y: Attack.pos_y / 2 - 40,
  2110. text: "MAX-HIT :",
  2111. "static": 1,
  2112. color: "#fff",
  2113. weight: "bold",
  2114. ctx: Attack.ctx2,
  2115. n: 0,
  2116. alpha: 0,
  2117. size: 16,
  2118. textAlign: "right"
  2119. });
  2120. e.to({
  2121. alpha: 1
  2122. },
  2123. 20, "Linear", "easeOut", 0);
  2124. var f = new easyGame.TextField({
  2125. x: 170,
  2126. y: Attack.pos_y / 2 - 40,
  2127. text: 0,
  2128. "static": 1,
  2129. alpha: 0,
  2130. color: "#fff",
  2131. weight: "bold",
  2132. ctx: Attack.ctx2,
  2133. n: 0,
  2134. size: 20,
  2135. textAlign: "left"
  2136. });
  2137. f.to({
  2138. alpha: 1
  2139. },
  2140. 20, "Linear", "easeOut", 0,
  2141. function() {
  2142. f.update = function() {
  2143. this.n <= Attack.player.maxHit && (this.n += Attack.player.maxHit / 20, this.text = this.n.toFixed(0))
  2144. }
  2145. });
  2146. var g = new easyGame.TextField({
  2147. x: 150,
  2148. y: Attack.pos_y / 2 + 40,
  2149. text: "SCORE :",
  2150. "static": 1,
  2151. alpha: 0,
  2152. color: "#fff",
  2153. weight: "bold",
  2154. ctx: Attack.ctx2,
  2155. n: 0,
  2156. size: 16,
  2157. textAlign: "right"
  2158. });
  2159. g.to({
  2160. alpha: 1
  2161. },
  2162. 20, "Linear", "easeOut", 40);
  2163. var h = new easyGame.TextField({
  2164. x: 170,
  2165. y: Attack.pos_y / 2 + 40,
  2166. text: 0,
  2167. "static": 1,
  2168. alpha: 0,
  2169. color: "#fff",
  2170. weight: "bold",
  2171. ctx: Attack.ctx2,
  2172. n: 0,
  2173. size: 20,
  2174. textAlign: "left"
  2175. });
  2176. h.to({
  2177. alpha: 1
  2178. },
  2179. 20, "Linear", "easeOut", 40,
  2180. function() {
  2181. h.update = function() {
  2182. this.n <= parseInt(Attack.all_mub) && (this.n += parseInt(Attack.all_mub) / 20, this.text = this.n.toFixed(0))
  2183. }
  2184. }),
  2185. this.easyGameList.push(this.fxBox, a, b, e, f, c, d, g, h)
  2186. };
  2187. var __x, __y;
  2188. game.prototype.ts = function(a) {
  2189. a.targetTouches && 1 == a.targetTouches.length && (a.preventDefault(), a = a.targetTouches[0]),
  2190. __x = a.pageX * Attack.p_x,
  2191. __y = a.pageY * Attack.p_x
  2192. },
  2193. game.prototype.tmove = function(a) {
  2194. a.targetTouches && 1 == a.targetTouches.length && (a.preventDefault(), a = a.targetTouches[0]),
  2195. Attack._x += a.pageX * Attack.p_x - __x,
  2196. Attack._y += a.pageY * Attack.p_x - __y,
  2197. __x = a.pageX * Attack.p_x,
  2198. __y = a.pageY * Attack.p_x,
  2199. Attack._x < 0 && (Attack._x = 0),
  2200. Attack._x > 320 && (Attack._x = 320),
  2201. Attack._y < 0 && (Attack._y = 0),
  2202. Attack._y > Attack.pos_y - 20 && (Attack._y = Attack.pos_y - 20)
  2203. },
  2204. game.prototype.tmove2 = function(a) {
  2205. Attack._x = a.pageX,
  2206. Attack._y = a.pageY,
  2207. Attack._x < 0 && (Attack._x = 0),
  2208. Attack._x > 320 && (Attack._x = 320),
  2209. Attack._y < 0 && (Attack._y = 0),
  2210. Attack._y > Attack.pos_y - 20 && (Attack._y = Attack.pos_y - 20)
  2211. },
  2212. game.prototype.next = function() {
  2213. this.player.wd = 2,
  2214. this.stageI++,
  2215. this.stage = this.stageList[this.stageI],
  2216. this.stage.t = 0;
  2217. var a = gameEnter;
  2218. this.player.x = 160,
  2219. this.player.y = 600,
  2220. IsPC() ? (a.removeEventListener("mousemove", this.tmove2, !1), a.addEventListener("mousemove", this.tmove2, !1)) : (a.removeEventListener("touchstart", this.ts, !1), a.removeEventListener("touchmove", this.tmove, !1), a.addEventListener("touchstart", this.ts, !1), a.addEventListener("touchmove", this.tmove, !1))
  2221. },
  2222. game.prototype.restart = function() {
  2223. this.mub_list = [null, null, null, null, null, null, null, null, null],
  2224. this.all_mub = "000000000",
  2225. Attack.gd = 1;
  2226. this.player=Attack.gd?new free(160,600,92,80,Attack.imgDx[65],2):new plane(160,600,66,51,Attack.imgDx[63],2);
  2227. var a = new stage(0, "STAGE 2", 2, 570, Attack.imgDx[32]);
  2228. a.sT = function() {
  2229. stage2(this.t)
  2230. };
  2231. var b = new stage(0, "STAGE 1", 2, 570, Attack.imgDx[77]);
  2232. b.sT = function() {
  2233. stage1(this.t)
  2234. },
  2235. this.stageList = [b, a],
  2236. this.stage = this.stageList[this.stageI],
  2237. this.stage.t = 0,
  2238. this.player.wd = 2,
  2239. Attack.score_init(parseInt(Attack.all_mub));
  2240. var c = gameEnter;
  2241. IsPC() ? (c.removeEventListener("mousemove", this.tmove2, !1), c.addEventListener("mousemove", this.tmove2, !1)) : (c.removeEventListener("touchstart", this.ts, !1), c.removeEventListener("touchmove", this.tmove, !1), c.addEventListener("touchstart", this.ts, !1), c.addEventListener("touchmove", this.tmove, !1))
  2242. },
  2243. game.prototype.start = function() {
  2244. this.mub_list = [null, null, null, null, null, null, null, null, null],
  2245. this.all_mub = "000000000",
  2246. this.player=Attack.gd?new free(160,600,92,80,Attack.imgDx[65],2):new plane(160,600,66,51,Attack.imgDx[63],2);
  2247. var a = new stage(0, "STAGE 2", 2, 570, Attack.imgDx[32]);
  2248. a.sT = function() {
  2249. stage2(this.t)
  2250. };
  2251. var b = new stage(0, "STAGE 1", 2, 570, Attack.imgDx[77]);
  2252. b.sT = function() {
  2253. stage1(this.t)
  2254. },
  2255. this.stageList = [b, a],
  2256. this.stageI = 0,
  2257. this.stage = this.stageList[this.stageI],
  2258. this.player.wd = 2,
  2259. Attack.score_init(parseInt(Attack.all_mub)),
  2260. Attack.drObj();
  2261. var c = gameEnter;
  2262. IsPC() ? (c.removeEventListener("mousemove", this.tmove2, !1), c.addEventListener("mousemove", this.tmove2, !1)) : (c.removeEventListener("touchstart", this.ts, !1), c.removeEventListener("touchmove", this.tmove, !1), c.addEventListener("touchstart", this.ts, !1), c.addEventListener("touchmove", this.tmove, !1));
  2263. },
  2264. game.prototype.init = function() {
  2265. this.sp1 = 10,
  2266. this.bzlist = [],
  2267. this.enemylist = [],
  2268. this.s = [],
  2269. this.s2 = [],
  2270. this.drPd = [],
  2271. this.drDpd = [],
  2272. this.drJg = [],
  2273. this.chenaList = [],
  2274. this.tanklist = [],
  2275. this.splist = [],
  2276. this.zd = "a",
  2277. this._x = 190,
  2278. this._y = Attack.pos_y - 160,
  2279. this.sL = 0,
  2280. this.over_t = 0,
  2281. this.dn = 0,
  2282. this.easyGameList = [],
  2283. easyGame.eventList = {},
  2284. this.hit_list = [null, null, null],
  2285. this.hit_mub = "000",
  2286. this.onStart = 0,
  2287. this.bzlist = [],
  2288. this.splist = [],
  2289. this.enemylist = [],
  2290. this.tanklist = []
  2291. };
  2292. var plane = function(a, b, c, d, e, f) {
  2293. this.x = a,
  2294. this.y = b,
  2295. this.w = c,
  2296. this.h = d,
  2297. this.img = e,
  2298. this.type = f,
  2299. this.blood = 3,
  2300. this.wd = 0,
  2301. this.wdk = 0,
  2302. this.score = 0,
  2303. this.nl = 200,
  2304. this.t = 0,
  2305. this.htime = 0,
  2306. this.hit_t = 0,
  2307. this.hit = 0,
  2308. this.speed = 5,
  2309. this.maxHit = 0,
  2310. this.kill = 0,
  2311. this.power = 1,
  2312. this.die = 0,
  2313. this.star = 0,
  2314. this.d = 4,
  2315. this.wd_h = 100,
  2316. this.tl = 0,
  2317. this.tr = 0,
  2318. this.tween_t = 0,
  2319. this.n_rad = 0,
  2320. this.dd = 1
  2321. };
  2322. plane.prototype.dr = function() {
  2323. var a = Attack.ctx2;
  2324. a.drawImage(this.img, this.w * Math.floor(this.d), this.h, this.w, this.h, this.x + 50, this.y + 80, .5 * this.w, .5 * this.h),
  2325. 0 == this.t % 10 && a.drawImage(Attack.imgDx[5], this.x + this.w / 2 - 32, this.y - 20),
  2326. a.save(),
  2327. a.drawImage(Attack.imgDx[61], 46 * (Math.floor(this.t / 2) % 3), 0, 46, 8, this.x + this.w / 2 - 17, this.y - 2, 34, 6),
  2328. a.drawImage(this.img, this.w * Math.floor(this.d), 0, this.w, this.h, this.x, this.y, this.w, this.h),
  2329. a.save(),
  2330. a.globalAlpha = Math.sin(this.t % 100 * Math.PI / 100),
  2331. a.drawImage(Attack.imgDx[27], 0, 12 * Math.floor(this.t / 4 % 2), 12, 12, this.x + this.w / 2 - 5, this.y + 18 - 5, 10, 10),
  2332. a.restore(),
  2333. 1 == this.wd && this.wdk < 120 ? (1 == this.wdk && (Attack.c.className = "gameOn", setTimeout(function() {
  2334. Attack.c.className = ""
  2335. },
  2336. 800), this.wd_h = 30), this.wdk < 40 ? this.wd_h += this.wdk: this.wd_h = 100, a.save(), a.translate(this.x + this.w / 2, this.y + this.h / 2), a.rotate(Math.PI / 12 * (Math.floor(this.wdk / 5) % 24)), a.drawImage(Attack.imgDx[62], 0, 0, 130, 130, -this.wd_h / 2, -this.wd_h / 2, this.wd_h, this.wd_h), a.restore(), this.wdk++) : 2 == this.wd && this.wdk < 300 ? (a.save(), a.translate(this.x + this.w / 2, this.y + this.h / 2), a.rotate(Math.PI / 12 * (Math.floor(this.wdk / 5) % 24)), a.drawImage(Attack.imgDx[62], 0, 0, 130, 130, -this.wd_h / 2, -this.wd_h / 2, this.wd_h, this.wd_h), a.restore(), this.wdk++) : (this.wd = 0, this.wdk = 0),
  2337. a.restore()
  2338. },
  2339. plane.prototype.ispower = function() {
  2340. switch (this.power) {
  2341. case 1:
  2342. 0 == this.t % 10 && (this.fire(this.x + 33 - 10, this.y + 8, 12, 30, 14, 2 * Math.PI), this.fire(this.x + 33 + 10, this.y + 8, 12, 30, 14, 2 * Math.PI));
  2343. break;
  2344. case 2:
  2345. 0 == this.t % 12 && (this.fire(this.x + 33 - 15, this.y + 8, 12, 30, 14, 2 * Math.PI), this.fire(this.x + 33 + 15, this.y + 8, 12, 30, 14, 2 * Math.PI), this.fire(this.x + 33, this.y + 18, 12, 30, 16, 2 * Math.PI));
  2346. break;
  2347. case 3:
  2348. 0 == this.t % 8 && (this.fire(this.x + 33 - 15, this.y + 8, 16, 30, 14, 2 * Math.PI), this.fire(this.x + 33 + 15, this.y + 8, 16, 30, 14, 2 * Math.PI), this.fire(this.x + 33, this.y + 8, 16, 30, 16, 2 * Math.PI));
  2349. break;
  2350. case 4:
  2351. 0 == this.t % 11 && (this.fire(this.x + 33 - 6, this.y + 8, 12, 30, 16, 2 * Math.PI), this.fire(this.x + 33 + 6, this.y + 8, 12, 30, 16, 2 * Math.PI), this.fire(this.x + 33 - 12, this.y + 8, 12, 30, 14, Math.PI / 50), this.fire(this.x + 33 + 12, this.y + 8, 12, 30, 14, -Math.PI / 50));
  2352. break;
  2353. case 5:
  2354. 0 == this.t % 9 && (this.fire(this.x + 33 - 6, this.y + 8, 14, 30, 16, 2 * Math.PI), this.fire(this.x + 33 + 6, this.y + 8, 14, 30, 16, 2 * Math.PI), this.fire(this.x + 33 - 12, this.y + 8, 14, 30, 14, Math.PI / 50), this.fire(this.x + 33 + 12, this.y + 8, 14, 30, 14, -Math.PI / 50));
  2355. break;
  2356. case 6:
  2357. 0 == this.t % 11 && (this.fire(this.x + 33 - 6, this.y + 8, 12, 30, 16, 2 * Math.PI), this.fire(this.x + 33 + 6, this.y + 8, 12, 30, 16, 2 * Math.PI), this.fire(this.x + 33 - 12, this.y + 8, 12, 30, 14, Math.PI / 50), this.fire(this.x + 33 + 12, this.y + 8, 12, 30, 14, -Math.PI / 50), this.fire(this.x + 33 - 22, this.y + 8, 12, 30, 14, Math.PI / 30), this.fire(this.x + 33 + 22, this.y + 8, 12, 30, 14, -Math.PI / 30));
  2358. break;
  2359. case 7:
  2360. 0 == this.t % 9 && (this.fire(this.x + 33 - 6, this.y + 8, 14, 30, 16, 2 * Math.PI), this.fire(this.x + 33 + 6, this.y + 8, 14, 30, 16, 2 * Math.PI), this.fire(this.x + 33 - 12, this.y + 8, 14, 30, 14, Math.PI / 50), this.fire(this.x + 33 + 12, this.y + 8, 14, 30, 14, -Math.PI / 50), this.fire(this.x + 33 - 22, this.y + 8, 14, 30, 14, Math.PI / 30), this.fire(this.x + 33 + 22, this.y + 8, 14, 30, 14, -Math.PI / 30));
  2361. break;
  2362. case 8:
  2363. 0 == this.t % 10 && (this.fire(this.x + 33 - 6, this.y + 8, 12, 30, 16, 2 * Math.PI), this.fire(this.x + 33 + 6, this.y + 8, 12, 30, 16, 2 * Math.PI), this.fire(this.x + 33 - 12, this.y + 8, 12, 30, 16, Math.PI / 50), this.fire(this.x + 33 + 12, this.y + 8, 12, 30, 16, -Math.PI / 50), this.fire(this.x + 33 - 22, this.y + 8, 12, 30, 14, Math.PI / 30), this.fire(this.x + 33 + 22, this.y + 8, 12, 30, 14, -Math.PI / 30), this.fire(this.x + 33 - 22, this.y + 8, 12, 30, 14, Math.PI / 10), this.fire(this.x + 33 + 22, this.y + 8, 12, 30, 14, -Math.PI / 10));
  2364. break;
  2365. case 9:
  2366. 0 == this.t % 9 && (this.fire(this.x + 33 - 6, this.y + 8, 14, 30, 16, 2 * Math.PI), this.fire(this.x + 33 + 6, this.y + 8, 14, 30, 16, 2 * Math.PI), this.fire(this.x + 33 - 12, this.y + 8, 14, 30, 16, Math.PI / 50), this.fire(this.x + 33 + 12, this.y + 8, 14, 30, 16, -Math.PI / 50), this.fire(this.x + 33 - 22, this.y + 8, 14, 30, 14, Math.PI / 30), this.fire(this.x + 33 + 22, this.y + 8, 14, 30, 14, -Math.PI / 30), this.fire(this.x + 33 - 22, this.y + 8, 14, 30, 14, Math.PI / 10), this.fire(this.x + 33 + 22, this.y + 8, 14, 30, 14, -Math.PI / 10));
  2367. break;
  2368. case 10:
  2369. 0 == this.t % 6 && (this.n_rad += Math.PI / 60 * Math.sin(this.t * Math.PI / 50), this.fire(this.x + 33 - 8, this.y + 8, 14, 30, 16, Math.PI / 80), this.fire(this.x + 33, this.y + 8, 12, 30, 16, 0), this.fire(this.x + 33 + 8, this.y + 8, 14, 30, 16, -Math.PI / 80), this.fire(this.x + 33 - 16, this.y + 8, 14, 30, 14, this.n_rad), this.fire(this.x + 33 + 16, this.y + 8, 14, 30, 14, -this.n_rad))
  2370. }
  2371. },
  2372. plane.prototype.isdd = function() {
  2373. switch (this.dd) {
  2374. case 1:
  2375. 50 == this.t % 60 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 3 * -Math.PI / 5), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 3 * Math.PI / 5));
  2376. break;
  2377. case 2:
  2378. 60 == this.t % 70 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 1 * -Math.PI / 2), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 1 * Math.PI / 2)),
  2379. 65 == this.t % 70 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 3 * -Math.PI / 5), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 3 * Math.PI / 5));
  2380. break;
  2381. case 3:
  2382. 60 == this.t % 80 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 1 * -Math.PI / 2), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 1 * Math.PI / 2)),
  2383. 65 == this.t % 80 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 3 * -Math.PI / 5), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 3 * Math.PI / 5)),
  2384. 70 == this.t % 80 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 4 * -Math.PI / 5), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 4 * Math.PI / 5));
  2385. break;
  2386. case 4:
  2387. 50 == this.t % 70 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 1 * -Math.PI / 2), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 1 * Math.PI / 2)),
  2388. 55 == this.t % 70 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 3 * -Math.PI / 5), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 3 * Math.PI / 5)),
  2389. 60 == this.t % 70 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 4 * -Math.PI / 5), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 4 * Math.PI / 5));
  2390. break;
  2391. case 5:
  2392. 60 == this.t % 80 && (this.fire(this.x + 33, this.y + 36, 8, 18, 2, 3 * -Math.PI / 10), this.fire(this.x + 33, this.y + 36, 8, 18, 2, 3 * Math.PI / 10)),
  2393. 65 == this.t % 80 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 1 * -Math.PI / 2), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 1 * Math.PI / 2)),
  2394. 70 == this.t % 80 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 3 * -Math.PI / 5), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 3 * Math.PI / 5)),
  2395. 75 == this.t % 80 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 4 * -Math.PI / 5), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 4 * Math.PI / 5));
  2396. break;
  2397. case 6:
  2398. 50 == this.t % 70 && (this.fire(this.x + 33, this.y + 36, 8, 18, 2, 3 * -Math.PI / 10), this.fire(this.x + 33, this.y + 36, 8, 18, 2, 3 * Math.PI / 10)),
  2399. 55 == this.t % 70 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 1 * -Math.PI / 2), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 1 * Math.PI / 2)),
  2400. 60 == this.t % 70 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 3 * -Math.PI / 5), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 3 * Math.PI / 5)),
  2401. 65 == this.t % 70 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 4 * -Math.PI / 5), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 4 * Math.PI / 5));
  2402. break;
  2403. case 7:
  2404. 30 == this.t % 40 && (this.fire(this.x + 33, this.y + 36, 8, 18, 2, 3 * -Math.PI / 10), this.fire(this.x + 33, this.y + 36, 8, 18, 2, 3 * Math.PI / 10)),
  2405. 55 == this.t % 70 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 1 * -Math.PI / 2), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 1 * Math.PI / 2)),
  2406. 40 == this.t % 50 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 3 * -Math.PI / 5), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 3 * Math.PI / 5)),
  2407. 65 == this.t % 70 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 4 * -Math.PI / 5), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 4 * Math.PI / 5));
  2408. break;
  2409. case 8:
  2410. 30 == this.t % 40 && (this.fire(this.x + 33, this.y + 36, 8, 18, 2, 3 * -Math.PI / 10), this.fire(this.x + 33, this.y + 36, 8, 18, 2, 3 * Math.PI / 10)),
  2411. 45 == this.t % 50 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 1 * -Math.PI / 2), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 1 * Math.PI / 2)),
  2412. 40 == this.t % 60 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 3 * -Math.PI / 5), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 3 * Math.PI / 5)),
  2413. 35 == this.t % 60 && (this.fire(this.x + 33, this.y + 26, 8, 18, 2, 4 * -Math.PI / 5), this.fire(this.x + 33, this.y + 26, 8, 18, 2, 4 * Math.PI / 5))
  2414. }
  2415. },
  2416. plane.prototype.fpao = function() {
  2417. this.ispower(),
  2418. this.isdd(),
  2419. this.t++
  2420. },
  2421. plane.prototype.fire = function(a, b, c, d, e, f, g) {
  2422. var h = new Pd(a, b, c, d, e, f);
  2423. h.speed = g,
  2424. Attack.drPd.push(h)
  2425. },
  2426. plane.prototype.zd = function() {
  2427. Attack.zd = new bomb(this.y + 25, this.x + this.w / 2),
  2428. 200 == this.nl && (this.wd = 2, this.wdk = 0, this.nl = 0, this.xd(), setTimeout(function() {
  2429. Attack.zd = "a",
  2430. gameDiv.className = ""
  2431. },
  2432. 4500))
  2433. },
  2434. plane.prototype.jNl = function(a) {
  2435. this.nl < 200 && (this.nl += a)
  2436. },
  2437. plane.prototype.xd = function() {
  2438. for (var a = Attack.drDpd,
  2439. b = 0; b < a.length; b++) Attack.s2.push(new star(a[b].x, a[b].y)),
  2440. a[b].die = 1
  2441. },
  2442. plane.prototype.isHit = function(a) {
  2443. var b = new OBB(new Vector2(this.x + this.w / 2, this.y + 18), 10, 10, 0);
  2444. return CollisionDetector.detectorOBBvsOBB(a, b) ? (this.hit > this.maxHit && (this.maxHit = this.hit), this.hit = 0, Attack.hit_list = [null, null, null, null], Attack.hit_mub = "0000", this.blood--, this.jNl(1), this.wd = 1, this.wdk = 0, 0 == this.blood && (this.die = 1, Attack.bzlist.push(new explode(this.x + 43, this.y + 36, 4))), 1) : 0
  2445. },
  2446. plane.prototype.eat = function(a, b, c) {
  2447. return (this.x + this.w / 2 - a) * (this.x + this.w / 2 - a) + (this.y + this.h / 2 - b) * (this.y + this.h / 2 - b) < c * c ? !0 : !1
  2448. },
  2449. plane.prototype.linear = function(a, b, c, d) {
  2450. return c * a / d + b
  2451. },
  2452. plane.prototype.moveZd = function() {
  2453. var a = Attack._x - this.x - this.w / 2,
  2454. b = Attack._y - this.y - this.h / 2; ! this.tl && a > 3 ? (this.tl = 1, this.tr = 0) : !this.tr && -3 > a ? (this.tr = 1, this.tl = 0) : 10 >= a && a >= -3 && (this.tr = 0, this.tl = 0),
  2455. this.x = Math.round(this.linear(this.tween_t, this.x, a, 100)),
  2456. this.y = Math.round(this.linear(this.tween_t, this.y, b, 100)),
  2457. this.tween_t++,
  2458. 100 == this.tween_t && (this.tween_t = 0),
  2459. this.tl ? this.d < 8 ? this.d += .5 : this.d = 8 : this.d > 4 && (this.d -= 1 / 8),
  2460. this.tr ? this.d > .5 ? this.d -= .5 : this.d = 0 : this.d < 4 && (this.d += 1 / 8)
  2461. };
  2462. var free = function(a, b, c, d, e, f) {
  2463. this.x = a,
  2464. this.y = b,
  2465. this.w = c,
  2466. this.h = d,
  2467. this.img = e,
  2468. this.type = f,
  2469. this.blood = 3,
  2470. this.wd = 0,
  2471. this.wdk = 0,
  2472. this.score = 0,
  2473. this.nl = 200,
  2474. this.t = 0,
  2475. this.htime = 0,
  2476. this.hit_t = 0,
  2477. this.hit = 0,
  2478. this.speed = 5,
  2479. this.maxHit = 0,
  2480. this.kill = 0,
  2481. this.power = 1,
  2482. this.die = 0,
  2483. this.star = 0,
  2484. this.d = 4,
  2485. this.wd_h = 100,
  2486. this.tl = 0,
  2487. this.tr = 0,
  2488. this.tween_t = 0,
  2489. this.n_rad = 0,
  2490. this.dd = 1,
  2491. this.swList = [],
  2492. this.swList2 = [],
  2493. this.smanList = []
  2494. };
  2495. free.prototype.dr = function() {
  2496. var a = Attack.ctx2;
  2497. this.power >= 7 && this.t > 1 && (this.t < 5 ? (this.s1.y += 2, this.s2.y += 2) : this.t < 10 && (this.s1.y -= 2, this.s2.y -= 2), this.t > 10 && this.t < 30 && (this.s1.rotation += Math.PI / 300, this.s2.rotation -= Math.PI / 300), this.t > 30 && this.t < 50 && (this.s3.rotation += Math.PI / 45, this.s4.rotation -= Math.PI / 45), this.t > 30 && this.t < 50 && (this.s5.rotation += Math.PI / 80, this.s6.rotation -= Math.PI / 80), this.power >= 9 && this.t % 50 < 30 && 0 == this.t % 3 && (a.save(), a.globalAlpha = Math.sin(this.t % 50 * Math.PI / 20), a.globalCompositeOperation = "lighter", a.drawImage(Attack.imgDx[107], this.x + this.w / 2 - 80 + random( - 30, 30), this.y - 20 + random( - 30, 30)), a.restore(), a.save(), a.globalAlpha = Math.sin(this.t % 50 * Math.PI / 20), a.globalCompositeOperation = "lighter", a.drawImage(Attack.imgDx[107], this.x + this.w / 2 + 25 + random( - 30, 30), this.y - 20 + random( - 30, 30)), a.restore())),
  2498. 1 == this.t && (this.swList = [], this.swList2 = [], this.s1 = new swing(Attack.imgDx[95], this.x, this.y, 42, 11, 45, 51, 0, 1), this.s2 = new swing(Attack.imgDx[96], this.x, this.y, 50, 11, 45, 51, 0, 2), this.s3 = new swing(Attack.imgDx[97], this.x, this.y, 43, 11, 48, 36, 0, 1), this.s4 = new swing(Attack.imgDx[98], this.x, this.y, 49, 11, 48, 36, 0, 2), this.s5 = new swing(Attack.imgDx[97], this.x, this.y, 43, 11, 48, 36, 0, 1), this.s6 = new swing(Attack.imgDx[98], this.x, this.y, 49, 11, 48, 36, 0, 2), this.swList2.push(this.s3, this.s4, this.s5, this.s6), this.swList.push(this.s1, this.s2)),
  2499. 1 != this.t || this.sn1 || (this.smanList = [], this.sn3 = new wingman(Attack.imgDx[99], this.x + this.w / 2, this.y + this.h / 2, 80, 10, 24, 36, 0, 2), this.sn4 = new wingman(Attack.imgDx[100], this.x + this.w / 2, this.y + this.h / 2, -80, 10, 24, 36, 0, 2), this.sn3.rotation = -Math.PI / 20, this.sn4.rotation = Math.PI / 20, this.smanList.push(this.sn3, this.sn4));
  2500. for (var b = this.swList2,
  2501. c = 0; c < b.length; c++) b[c].die && b.splice(c, 1);
  2502. for (var c = 0; c < b.length; c++) b[c].run(),
  2503. b[c].dr(a);
  2504. a.drawImage(this.img, this.w * Math.floor(this.d), 0, this.w, this.h, this.x, this.y, this.w, this.h),
  2505. a.save(),
  2506. a.drawImage(Attack.imgDx[27], 0, 12 * Math.floor(this.t / 4 % 2), 12, 12, this.x + this.w / 2 - 5, this.y + 18 - 5, 10, 10),
  2507. a.restore();
  2508. for (var d = this.swList,
  2509. c = 0; c < d.length; c++) d[c].die && d.splice(c, 1);
  2510. for (var c = 0; c < d.length; c++) d[c].run(),
  2511. d[c].dr(a);
  2512. for (var e = this.smanList,
  2513. c = 0; c < e.length; c++) e[c].die && e.splice(c, 1);
  2514. for (var c = 0; c < e.length; c++) e[c].run(),
  2515. e[c].dr(a);
  2516. 1 == this.wd && this.wdk < 120 ? (1 == this.wdk && (Attack.c.className = "gameOn", setTimeout(function() {
  2517. Attack.c.className = ""
  2518. },
  2519. 800), this.wd_h = 30), this.wdk < 40 ? this.wd_h += this.wdk: this.wd_h = 100, a.save(), a.translate(this.x + this.w / 2, this.y + this.h / 2), a.rotate(Math.PI / 12 * (Math.floor(this.wdk / 5) % 24)), a.drawImage(Attack.imgDx[62], 0, 0, 130, 130, -this.wd_h / 2, -this.wd_h / 2, this.wd_h, this.wd_h), a.restore(), this.wdk++) : 2 == this.wd && this.wdk < 300 ? (a.save(), a.translate(this.x + this.w / 2, this.y + this.h / 2), a.rotate(Math.PI / 12 * (Math.floor(this.wdk / 5) % 24)), a.drawImage(Attack.imgDx[62], 0, 0, 130, 130, -this.wd_h / 2, -this.wd_h / 2, this.wd_h, this.wd_h), a.restore(), this.wdk++) : (this.wd = 0, this.wdk = 0),
  2520. a.restore()
  2521. },
  2522. free.prototype.ispower = function() {
  2523. switch (this.power) {
  2524. case 1:
  2525. 0 == this.t % 8 && (this.fire( - 18, this.y + 10, 30, 104, 36, 0), this.fire(18, this.y + 10, 30, 104, 37, 0));
  2526. break;
  2527. case 2:
  2528. 0 == this.t % 9 && (this.fire( - 18, this.y + 10, 30, 104, 36, 0), this.fire(18, this.y + 10, 30, 104, 37, 0), this.fire(this.x + 46, this.y + 10, 30, 104, 40, 0));
  2529. break;
  2530. case 3:
  2531. 0 == this.t % 10 && (this.fire( - 12, this.y + 10, 30, 104, 36, 0), this.fire(12, this.y + 10, 30, 104, 37, 0), this.fire( - 24, this.y + 10, 30, 104, 38, 0), this.fire(24, this.y + 10, 30, 104, 39, 0));
  2532. break;
  2533. case 4:
  2534. 0 == this.t % 8 && (this.fire( - 12, this.y + 10, 30, 104, 36, 0), this.fire(12, this.y + 10, 30, 104, 37, 0), this.fire( - 24, this.y + 10, 30, 104, 38, 0), this.fire(24, this.y + 10, 30, 104, 39, 0));
  2535. break;
  2536. case 5:
  2537. 0 == this.t % 9 && (this.fire( - 12, this.y + 10, 30, 104, 36, 0), this.fire(12, this.y + 10, 30, 104, 37, 0), this.fire( - 24, this.y + 10, 30, 104, 38, 0), this.fire(24, this.y + 10, 30, 104, 39, 0), this.fire(this.x + 46, this.y + 10, 30, 104, 40, 0));
  2538. break;
  2539. case 6:
  2540. 0 == this.t % 7 && (this.fire( - 14, this.y + 10, 30, 104, 36, 0), this.fire(14, this.y + 10, 30, 104, 37, 0), this.fire( - 28, this.y + 10, 30, 104, 38, 0), this.fire(28, this.y + 10, 30, 104, 39, 0), this.fire(this.x + 46, this.y + 10, 30, 104, 40, 0));
  2541. break;
  2542. case 7:
  2543. 0 == this.t % 13 && this.fire(0, this.y + 20, 34, 80, 41, 0, 10);
  2544. break;
  2545. case 8:
  2546. 0 == this.t % 12 && this.fire(0, this.y + 20, 38, 80, 41, 0, 10),
  2547. 0 == this.t % 10 && (this.fire( - 18, this.y + 10, 30, 104, 36, 0), this.fire(18, this.y + 10, 30, 104, 37, 0));
  2548. break;
  2549. case 9:
  2550. 0 == this.t % 15 && (this.fire( - 14, this.y + 15, 34, 80, 41, 0, 10), this.fire(14, this.y + 15, 34, 80, 41, 0, 10));
  2551. break;
  2552. case 10:
  2553. 0 == this.t % 11 && (this.fire( - 16, this.y + 15, 38, 80, 41, 0, 10), this.fire(16, this.y + 15, 38, 80, 41, 0, 10))
  2554. }
  2555. },
  2556. free.prototype.isdd = function() {
  2557. switch (this.dd) {
  2558. case 1:
  2559. 1 == this.t % 60 && (this.sn3.fire( - 3, -30, 4, 40, 35, 2, 3), this.sn4.fire(3, -30, 4, 40, 35, 2, 3));
  2560. break;
  2561. case 2:
  2562. 1 == this.t % 45 && (this.sn3.fire( - 3, -30, 4, 40, 35, 2, 3), this.sn4.fire(3, -30, 4, 40, 35, 2, 3));
  2563. break;
  2564. case 3:
  2565. 1 == this.t % 30 && (this.sn3.fire( - 3, -30, 4, 40, 35, 2, 3), this.sn4.fire(3, -30, 4, 40, 35, 2, 3));
  2566. break;
  2567. case 4:
  2568. 1 == this.t % 65 && (this.sn3.fire( - 3, -30, 4, 40, 35, 2, 3), this.sn4.fire(3, -30, 4, 40, 35, 2, 3)),
  2569. 1 == this.t % 45 && (this.sn3.fire( - 3, -30, 4, 40, 35, 2, 3), this.sn4.fire(3, -30, 4, 40, 35, 2, 3));
  2570. break;
  2571. case 5:
  2572. 1 == this.t % 55 && (this.sn3.fire( - 3, -30, 4, 40, 35, 2, 3), this.sn4.fire(3, -30, 4, 40, 35, 2, 3)),
  2573. 1 == this.t % 35 && (this.sn3.fire( - 3, -30, 4, 40, 35, 2, 3), this.sn4.fire(3, -30, 4, 40, 35, 2, 3));
  2574. break;
  2575. case 6:
  2576. 1 == this.t % 45 && (this.sn3.fire( - 3, -30, 4, 40, 35, 2, 3), this.sn4.fire(3, -30, 4, 40, 35, 2, 3)),
  2577. 1 == this.t % 25 && (this.sn3.fire( - 3, -30, 4, 40, 35, 2, 3), this.sn4.fire(3, -30, 4, 40, 35, 2, 3));
  2578. break;
  2579. case 7:
  2580. 1 == this.t % 16 && (this.sn3.fire( - 3, -30, 4, 40, 35, 2, 3), this.sn4.fire(3, -30, 4, 40, 35, 2, 3));
  2581. break;
  2582. case 8:
  2583. 1 == this.t % 12 && (this.sn3.fire( - 3, -30, 4, 40, 35, 2, 3), this.sn4.fire(3, -30, 4, 40, 35, 2, 3))
  2584. }
  2585. },
  2586. free.prototype.fpao = function() {
  2587. this.ispower(),
  2588. this.isdd(),
  2589. this.t++
  2590. },
  2591. free.prototype.fire = function(a, b, c, d, e, f, g) {
  2592. var h = new Pd(a, b, c, d, e, f);
  2593. h.speed = g,
  2594. Attack.drPd.push(h)
  2595. },
  2596. free.prototype.zd = function() {
  2597. Attack.zd = new bomb(this.y + 25, this.x + this.w / 2),
  2598. 200 == this.nl && (this.wd = 2, this.wdk = 0, this.nl = 0, this.xd(), setTimeout(function() {
  2599. Attack.zd = "a",
  2600. gameDiv.className = ""
  2601. },
  2602. 4500))
  2603. },
  2604. free.prototype.jNl = function(a) {
  2605. this.nl < 200 && (this.nl += a)
  2606. },
  2607. free.prototype.xd = function() {
  2608. for (var a = Attack.drDpd,
  2609. b = 0; b < a.length; b++) Attack.s2.push(new star(a[b].x, a[b].y)),
  2610. a[b].die = 1
  2611. },
  2612. free.prototype.isHit = function(a) {
  2613. var b = new OBB(new Vector2(this.x + this.w / 2, this.y + 18), 10, 10, 0);
  2614. return CollisionDetector.detectorOBBvsOBB(a, b) ? (this.hit > this.maxHit && (this.maxHit = this.hit), this.hit = 0, Attack.hit_list = [null, null, null, null], Attack.hit_mub = "0000", this.blood--, this.jNl(1), this.wd = 1, this.wdk = 0, 0 == this.blood && (this.die = 1, Attack.bzlist.push(new explode(this.x + 43, this.y + 36, 4))), 1) : 0
  2615. };
  2616. var wingman = function(a, b, c, d, e, f, g, h, i) {
  2617. this._x = d,
  2618. this.img = a,
  2619. this._y = e,
  2620. this.w = f,
  2621. this.h = g,
  2622. this.alpha = 1,
  2623. this.die = 0,
  2624. this.player = Attack.player,
  2625. this.x = b + this._x,
  2626. this.y = c + this._y,
  2627. this.rotation = h,
  2628. this.d_rad = h,
  2629. this.type = i,
  2630. this.rot = 0,
  2631. this.t = 0,
  2632. 1 === this.type && (this.x = this.player.x + this.player.w / 2 + 50 * Math.sin(this.t * Math.PI / 50), this.y = this.player.h + this.player.h / 2 + 20 * Math.cos(this.t * Math.PI / 50))
  2633. };
  2634. wingman.prototype.dr = function(a) {
  2635. a.save(),
  2636. a.translate(this.x, this.y),
  2637. this.alpha < 1 && (a.globalAlpha = this.alpha),
  2638. this.rotation && a.rotate(this.rotation),
  2639. a.drawImage(this.img, -this.w / 2, -this.h / 2),
  2640. a.restore()
  2641. },
  2642. wingman.prototype.run = function() {
  2643. if (this.t++, 2 == this.type) {
  2644. if (this.x = this.player.x + this.player.w / 2 + this._x, this.y = this.player.y + this.player.h / 2 + this._y + 2 * Math.sin(Math.PI / 20 * this.t), 1 == this.t % 30) {
  2645. var a = random(0, Attack.enemylist.length);
  2646. this._enemy = Attack.enemylist[a]
  2647. }
  2648. if (this._enemy && this.t % 30 > 10 && this.t % 30 < 28) {
  2649. var b = this.x - this._enemy.x - this._enemy.width / 2,
  2650. c = this.y - this._enemy.y - this._enemy.hight / 2,
  2651. d = Math.sqrt(b * b + c * c);
  2652. this.sin1 = b / d,
  2653. c > 0 && (this.arc3 = -Math.asin(this.sin1), this.rotation < this.arc3 ? this.rotation += Math.PI / 20 : this.rotation -= Math.PI / 20)
  2654. }
  2655. }
  2656. },
  2657. wingman.prototype.fire = function(a, b, c, d, e, f, g, h) {
  2658. var i = b,
  2659. j = a,
  2660. k = Math.round(j * Math.cos(this.rotation) - i * Math.sin(this.rotation)),
  2661. l = Math.round(j * Math.sin(this.rotation) + i * Math.cos(this.rotation)),
  2662. m = Math.round(k + this.x),
  2663. n = Math.round(l + this.y),
  2664. o = new Pd(m, n, c, d, e, -this.rotation);
  2665. o.speed = g,
  2666. o.m = k,
  2667. o.n = l,
  2668. o.obj = this,
  2669. o.img = h,
  2670. Attack.drPd.push(o)
  2671. },
  2672. free.prototype.eat = function(a, b, c) {
  2673. return (this.x + this.w / 2 - a) * (this.x + this.w / 2 - a) + (this.y + this.h / 2 - b) * (this.y + this.h / 2 - b) < c * c ? !0 : !1
  2674. },
  2675. free.prototype.linear = function(a, b, c, d) {
  2676. return c * a / d + b
  2677. },
  2678. free.prototype.moveZd = function() {
  2679. var a = Attack._x - this.x - this.w / 2,
  2680. b = Attack._y - this.y - this.h / 2; ! this.tl && a > 3 ? (this.tl = 1, this.tr = 0) : !this.tr && -3 > a ? (this.tr = 1, this.tl = 0) : 10 >= a && a >= -3 && (this.tr = 0, this.tl = 0),
  2681. this.x = Math.round(this.linear(this.tween_t, this.x, a, 100)),
  2682. this.y = Math.round(this.linear(this.tween_t, this.y, b, 100)),
  2683. this.tween_t++,
  2684. 100 == this.tween_t && (this.tween_t = 0),
  2685. this.tl ? this.d < 4 ? this.d += .5 : this.d = 4 : this.d > 2 && (this.d -= 1 / 8),
  2686. this.tr ? this.d > .5 ? this.d -= .5 : this.d = 0 : this.d < 2 && (this.d += 1 / 8)
  2687. };
  2688. var swing = function(a, b, c, d, e, f, g, h, i) {
  2689. this._x = d,
  2690. this.img = a,
  2691. this._y = e,
  2692. this.width = f,
  2693. this.height = g,
  2694. this.alpha = 1,
  2695. this.die = 0,
  2696. this.player = Attack.player,
  2697. this.x = b + this._x,
  2698. this.y = c + this._y,
  2699. this.rotation = h,
  2700. this.type = i
  2701. };
  2702. swing.prototype.dr = function(a) {
  2703. a.save(),
  2704. a.translate(this.x, this.y),
  2705. this.alpha < 1 && (a.globalAlpha = this.alpha),
  2706. this.lig && (a.globalCompositeOperation = "lighter"),
  2707. this.rotation && a.rotate(this.rotation),
  2708. 1 == this.type ? a.drawImage(this.img, -this.width, 0) : a.drawImage(this.img, 0, 0),
  2709. a.restore()
  2710. },
  2711. swing.prototype.run = function() {
  2712. this.x = this.player.x + this._x,
  2713. this.y = this.player.y + this._y
  2714. };
  2715. var enemy = function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) {
  2716. this.x = a,
  2717. this.y = b,
  2718. this.hight = f,
  2719. this.width = e,
  2720. this.img = c,
  2721. this.blood = d,
  2722. this.bj = 0,
  2723. this.t = 0,
  2724. this.t2 = 0,
  2725. this.mtype = g,
  2726. this.zdc = h,
  2727. this.swX = j,
  2728. this.swY = k,
  2729. this.timer = i,
  2730. this.bz = l,
  2731. this.die = 0,
  2732. this.n = 0,
  2733. this.leg = m,
  2734. this.dh = 0,
  2735. this.arc = 0,
  2736. this.arc2 = 0,
  2737. this.arc3 = 0,
  2738. this.arc4 = 0,
  2739. this.lxj = n,
  2740. this.chena = o,
  2741. this.m2 = 0,
  2742. this.n2 = 0
  2743. };
  2744. enemy.prototype.fpao = function() {
  2745. this.t2 == this.timer && (this.fire(), this.t2 = 0)
  2746. },
  2747. enemy.prototype.dr = function() {
  2748. var a = Attack.ctx2;
  2749. if (0 != this.swX ? (a.save(), a.translate(this.x + this.width / 2 + this.swX, this.y + this.hight / 2 + this.swY), a.rotate(this.arc), a.drawImage(this.img, this.width * (2 * this.leg + Math.floor(this.dh)), 0, this.width, this.hight, -this.width / 2, -this.hight / 2, this.width, this.hight), a.restore()) : (a.save(), a.translate(this.x + this.width / 2 + 3, this.y + this.hight / 2 + 3), a.rotate(this.arc), a.drawImage(this.img, this.width * (2 * this.leg + Math.floor(this.dh)), 0, this.width, this.hight, -this.width / 2, -this.hight / 2, this.width, this.hight), a.restore()), a.save(), a.translate(this.x + this.width / 2, this.y + this.hight / 2), a.rotate(this.arc), this.bj ? a.drawImage(this.img, this.width * (1 * this.leg + Math.floor(this.dh)), 0, this.width, this.hight, -this.width / 2, -this.hight / 2, this.width, this.hight) : a.drawImage(this.img, this.width * +Math.floor(this.dh), 0, this.width, this.hight, -this.width / 2, -this.hight / 2, this.width, this.hight), a.restore(), 1 == this.tank) {
  2750. a.save();
  2751. var b = this.x + this.width / 2,
  2752. c = this.y + this.hight / 2,
  2753. d = 0,
  2754. e = 0,
  2755. f = Math.round(e * Math.cos(this.arc) - d * Math.sin(this.arc) + b),
  2756. g = Math.round(e * Math.sin(this.arc) + d * Math.cos(this.arc) + c);
  2757. a.translate(f, g),
  2758. a.rotate(this.arc2),
  2759. a.drawImage(Attack.imgDx[3], -9, -9),
  2760. a.restore()
  2761. }
  2762. if (2 == this.tank) {
  2763. var b = this.x + this.width / 2,
  2764. c = this.y + this.hight / 2,
  2765. d = 0,
  2766. e = 0,
  2767. f = Math.round(e * Math.cos(this.arc) - d * Math.sin(this.arc) + b),
  2768. g = Math.round(e * Math.sin(this.arc) + d * Math.cos(this.arc) + c);
  2769. a.save(),
  2770. a.translate(f + 3, g + 3),
  2771. a.rotate(this.arc2),
  2772. a.drawImage(Attack.imgDx[48], 48, 0, 24, 48, -12, -24, 24, 48),
  2773. a.restore(),
  2774. a.save(),
  2775. a.translate(f, g),
  2776. a.rotate(this.arc2),
  2777. this.bj ? a.drawImage(Attack.imgDx[48], 24, 0, 24, 48, -12, -24, 24, 48) : a.drawImage(Attack.imgDx[48], 0, 0, 24, 48, -12, -24, 24, 48),
  2778. a.restore()
  2779. }
  2780. if (3 == this.tank) {
  2781. var b = this.x + this.width / 2,
  2782. c = this.y + this.hight / 2,
  2783. d = 0,
  2784. e = 0,
  2785. f = Math.round(e * Math.cos(this.arc) - d * Math.sin(this.arc) + b),
  2786. g = Math.round(e * Math.sin(this.arc) + d * Math.cos(this.arc) + c);
  2787. a.save(),
  2788. a.translate(f + 3, g + 3),
  2789. a.rotate(this.arc2),
  2790. a.drawImage(Attack.imgDx[59], 64, 0, 32, 47, -16, -23.5, 32, 47),
  2791. a.restore(),
  2792. a.save(),
  2793. a.translate(f, g),
  2794. a.rotate(this.arc2),
  2795. this.bj ? a.drawImage(Attack.imgDx[59], 32, 0, 32, 47, -16, -23.5, 32, 47) : a.drawImage(Attack.imgDx[59], 0, 0, 32, 47, -16, -23.5, 32, 47),
  2796. a.restore()
  2797. }
  2798. if (4 == this.tank) {
  2799. a.save();
  2800. var b = this.x + this.width / 2,
  2801. c = this.y + this.hight / 2,
  2802. d = 0,
  2803. e = 0,
  2804. f = Math.round(e * Math.cos(this.arc) - d * Math.sin(this.arc) + b),
  2805. g = Math.round(e * Math.sin(this.arc) + d * Math.cos(this.arc) + c);
  2806. a.translate(f, g),
  2807. a.rotate(this.arc2),
  2808. a.drawImage(Attack.imgDx[73], -11, -11),
  2809. a.restore()
  2810. }
  2811. if (5 == this.tank) {
  2812. a.save();
  2813. var b = this.x + this.width / 2,
  2814. c = this.y + this.hight / 2,
  2815. d = 0,
  2816. e = 0,
  2817. f = Math.round(e * Math.cos(this.arc) - d * Math.sin(this.arc) + b),
  2818. g = Math.round(e * Math.sin(this.arc) + d * Math.cos(this.arc) + c);
  2819. a.translate(f, g),
  2820. a.rotate(this.arc2),
  2821. a.drawImage(Attack.imgDx[74], -10, -10),
  2822. a.restore()
  2823. }
  2824. if (6 == this.tank) {
  2825. a.save();
  2826. var b = this.x + this.width / 2,
  2827. c = this.y + this.hight / 2,
  2828. d = 0,
  2829. e = 0,
  2830. f = Math.round(e * Math.cos(this.arc) - d * Math.sin(this.arc) + b),
  2831. g = Math.round(e * Math.sin(this.arc) + d * Math.cos(this.arc) + c);
  2832. a.translate(f, g + 72),
  2833. a.rotate(this.arc2),
  2834. a.drawImage(Attack.imgDx[79], -14, -14),
  2835. a.restore()
  2836. }
  2837. if (7 == this.tank) {
  2838. var b = this.x + this.width / 2,
  2839. c = this.y + this.hight / 2,
  2840. d = 0,
  2841. e = 0,
  2842. f = Math.round(e * Math.cos(this.arc) - d * Math.sin(this.arc) + b),
  2843. g = Math.round(e * Math.sin(this.arc) + d * Math.cos(this.arc) + c);
  2844. a.save(),
  2845. a.translate(f + 100, g - 75),
  2846. a.rotate(this.arc2),
  2847. a.drawImage(Attack.imgDx[79], -14, -14),
  2848. a.restore(),
  2849. a.save(),
  2850. a.translate(f + 140, g - 85),
  2851. a.rotate(this.arc2),
  2852. a.drawImage(Attack.imgDx[79], -14, -14),
  2853. a.restore(),
  2854. a.save(),
  2855. a.translate(f - 100, g - 75),
  2856. a.rotate(this.arc4),
  2857. a.drawImage(Attack.imgDx[79], -14, -14),
  2858. a.restore(),
  2859. a.save(),
  2860. a.translate(f - 140, g - 83),
  2861. a.rotate(this.arc4),
  2862. a.drawImage(Attack.imgDx[79], -14, -14),
  2863. a.restore()
  2864. }
  2865. if (1 == this.lxj) {
  2866. a.save();
  2867. var b = this.x + this.width / 2,
  2868. c = this.y + this.hight / 2,
  2869. d = 0,
  2870. e = 0,
  2871. f = Math.round(e * Math.cos(this.arc) - d * Math.sin(this.arc) + b),
  2872. g = Math.round(e * Math.sin(this.arc) + d * Math.cos(this.arc) + c);
  2873. a.translate(f, g),
  2874. a.rotate(Math.PI / 24 * this.t % 24),
  2875. a.drawImage(Attack.imgDx[8], -34, -34),
  2876. a.restore()
  2877. }
  2878. if (2 == this.lxj) {
  2879. a.save();
  2880. var b = this.x + this.width / 2,
  2881. c = this.y + this.hight / 2,
  2882. d = -30,
  2883. e = 0,
  2884. f = Math.round(e * Math.cos(this.arc) - d * Math.sin(this.arc) + b),
  2885. g = Math.round(e * Math.sin(this.arc) + d * Math.cos(this.arc) + c);
  2886. a.translate(f, g),
  2887. a.rotate(Math.PI / 24 * this.t % 24),
  2888. a.drawImage(Attack.imgDx[44], -90, -90),
  2889. a.restore()
  2890. }
  2891. if (3 == this.lxj) {
  2892. a.save();
  2893. var b = this.x + this.width / 2,
  2894. c = this.y + this.hight / 2,
  2895. d = -11,
  2896. e = 37,
  2897. f = Math.round(e * Math.cos(this.arc) - d * Math.sin(this.arc) + b),
  2898. g = Math.round(e * Math.sin(this.arc) + d * Math.cos(this.arc) + c);
  2899. a.translate(f, g),
  2900. a.rotate(Math.PI / 12 * this.t % 12),
  2901. a.drawImage(Attack.imgDx[52], -34, -34),
  2902. a.restore(),
  2903. a.save();
  2904. var b = this.x + this.width / 2,
  2905. c = this.y + this.hight / 2,
  2906. d = -11,
  2907. e = -38,
  2908. f = Math.round(e * Math.cos(this.arc) - d * Math.sin(this.arc) + b),
  2909. g = Math.round(e * Math.sin(this.arc) + d * Math.cos(this.arc) + c);
  2910. a.translate(f, g),
  2911. a.rotate(Math.PI / 12 * this.t % 12),
  2912. a.drawImage(Attack.imgDx[52], -34, -34),
  2913. a.restore(),
  2914. a.save();
  2915. var b = this.x + this.width / 2,
  2916. c = this.y + this.hight / 2,
  2917. d = this.hight / 2 - 5,
  2918. e = 0,
  2919. f = Math.round(e * Math.cos(this.arc) - d * Math.sin(this.arc) + b),
  2920. g = Math.round(e * Math.sin(this.arc) + d * Math.cos(this.arc) + c);
  2921. a.translate(f, g),
  2922. a.rotate(this.arc),
  2923. a.drawImage(Attack.imgDx[61], 46 * (this.t % 3), 0, 46, 8, -17, -3, 34, 6),
  2924. a.restore()
  2925. }
  2926. if (4 == this.lxj) {
  2927. a.save();
  2928. var b = this.x + this.width / 2,
  2929. c = this.y + this.hight / 2,
  2930. d = this.hight / 2,
  2931. e = 0,
  2932. f = Math.round(e * Math.cos(this.arc) - d * Math.sin(this.arc) + b),
  2933. g = Math.round(e * Math.sin(this.arc) + d * Math.cos(this.arc) + c);
  2934. a.translate(f, g),
  2935. a.rotate(this.arc),
  2936. a.drawImage(Attack.imgDx[61], 46 * (this.t % 3), 0, 46, 8, -17, -3, 34, 6),
  2937. a.restore()
  2938. }
  2939. this.t2++,
  2940. this.bj = 0
  2941. },
  2942. enemy.prototype.moveto = function(a) {
  2943. this.a_arc = (this.arc2 - a) / 20
  2944. },
  2945. enemy.prototype.isHit = function(a) {
  2946. var b = this.y + this.hight / 2,
  2947. c = this.x + this.width / 2,
  2948. d = new OBB(new Vector2(c, b), this.width, this.hight, this.arc);
  2949. return CollisionDetector.detectorOBBvsOBB(a, d) ? (this.blood--, this.blood || (Attack.bzlist.push(new explode(c, b, this.bz)), this.chena && Attack.chenaList.push(new chena(this.x, this.y, this.chena.img, this.chena.mfx, this.chena.type, this.width, this.hight, this.arc)), this.die = 1, Attack.player.kill++, this.blood = 1e3, 100 * Math.random() < 3 && Attack.s2.push(new star(c, b, 1)), 100 * Math.random() < 4 && Attack.s2.push(new star(c, b, 3)), 100 * Math.random() < 3 && Attack.s2.push(new star(c, b, 2))), this.bj = 1, 1) : 0
  2950. },
  2951. enemy.prototype.bzd = function(a, b, c) {
  2952. if (this.x > a - c - this.width && this.x < a + c + this.width && this.y > b - c - this.hight && this.y < b + c + this.hight) {
  2953. var d = this.y + this.hight / 2,
  2954. e = this.x + this.width / 2;
  2955. return this.blood -= 1,
  2956. this.blood <= 0 && (Attack.s2.push(new star(e, d)), Attack.bzlist.push(new explode(e, d, this.bz)), this.chena && Attack.chenaList.push(new chena(this.x, this.y, this.chena.img, this.chena.mfx, this.chena.type, this.width, this.hight, this.arc)), this.die = 1),
  2957. this.bj = 1,
  2958. 1
  2959. }
  2960. return 0
  2961. },
  2962. enemy.prototype.fire = function(a, b, c, d, e, f, g, h) {
  2963. var i = this.x + this.width / 2,
  2964. j = this.y + this.hight / 2,
  2965. k = a || i,
  2966. l = b || j + 10,
  2967. m = l - j,
  2968. n = k - i;
  2969. if (1 == h) var o = this.arc;
  2970. else var o = this.arc2 || this.arc;
  2971. var p = Math.round(n * Math.cos(o) - m * Math.sin(o) + i),
  2972. q = Math.round(n * Math.sin(o) + m * Math.cos(o) + j);
  2973. 2 == h && (q += 72),
  2974. 3 == h && (p += 100, q -= 75),
  2975. 4 == h && (p += 140, q -= 85);
  2976. var f = f || 0,
  2977. r = d || 1,
  2978. s = e || 1,
  2979. c = c || this.zdc,
  2980. t = new Pd(p, q, r, s, c, f);
  2981. t.speed = g,
  2982. Attack.drDpd.push(t)
  2983. },
  2984. enemy.prototype.check = function() {
  2985. return this.x <= -this.hight || this.x >= 360 || this.y > 600 || this.y < -this.hight ? 0 : 1
  2986. },
  2987. enemy.prototype.move = function() {
  2988. switch (this.t++, this.mtype) {
  2989. case 1:
  2990. this.y += Math.round(4 * Math.cos(this.arc)),
  2991. this.x -= Math.round(4 * Math.sin(this.arc)),
  2992. this.arc -= Math.PI / 190,
  2993. 300 == this.t && (this.die = 1);
  2994. break;
  2995. case 2:
  2996. this.y += 2.5;
  2997. break;
  2998. case 5:
  2999. this.x += Math.sin(this.t * Math.PI / 100),
  3000. this.t < 300 && (this.y -= 2 + Math.cos(this.t * Math.PI / 100));
  3001. break;
  3002. case 6:
  3003. this.x += Math.sin(this.t * Math.PI / 100),
  3004. 1 == this.t % 302 && (this.swY = 1e3),
  3005. 164 == this.t % 302 && (this.swY = 86),
  3006. 290 == this.t % 302 && (this.swY = 1e3, this.arc2 = 0),
  3007. this.t < 300 && (this.y -= 2 + Math.cos(this.t * Math.PI / 100)),
  3008. this.t % 302 > 150 && this.t % 302 < 176 ? this.x += 1.4 : this.t % 302 < 275 || this.t % 302 < 300 && (this.x -= 1.4);
  3009. break;
  3010. case 7:
  3011. this.x += Math.sin(this.t * Math.PI / 100),
  3012. this.t < 300 && (this.y -= 2 + Math.cos(this.t * Math.PI / 100)),
  3013. 1 == this.t % 302 && (this.swY = 1e3),
  3014. 290 == this.t % 302 && (this.swY = 1e3, this.arc2 = 0),
  3015. 164 == this.t % 302 && (this.swY = 86),
  3016. this.t % 302 > 150 && this.t % 302 < 176 ? this.x -= 1.4 : this.t % 302 < 275 || this.t % 302 < 300 && (this.x += 1.4);
  3017. break;
  3018. case 3:
  3019. this.t < 90 ? this.y += 2 : this.t < 190 ? (this.arc += Math.PI / 200, this.y -= Math.cos(this.arc) - 2, this.x += .5 * Math.sin(this.arc)) : (this.y += 1.5 * Math.cos(this.arc) + 2, this.x -= 1 * Math.sin(this.arc), this.arc += Math.PI / 200);
  3020. break;
  3021. case 4:
  3022. this.y += 2;
  3023. break;
  3024. case 8:
  3025. this.t < 100 ? (this.arc -= Math.PI / 100, this.y += 4 * Math.cos(this.arc), this.x -= 4 * Math.sin(this.arc)) : this.t < 300 ? (this.arc += Math.PI / 100, this.y += 4 * Math.cos(this.arc), this.x -= 4 * Math.sin(this.arc)) : this.t < 312 ? (this.y += 4 * Math.cos(this.arc), this.x -= 4 * Math.sin(this.arc)) : (this.y += 4 * Math.cos(this.arc), this.x -= 4 * Math.sin(this.arc));
  3026. break;
  3027. case 9:
  3028. this.t < 36 && (this.y += 3),
  3029. this.x += Math.sin(this.t * Math.PI / 120),
  3030. this.y += .6 * Math.sin(this.t * Math.PI / 200);
  3031. break;
  3032. case 10:
  3033. this.t < 90 ? this.y += 2.5 : this.t < 140 ? (this.arc += Math.PI / 100, this.y += 2) : this.t < 160 ? (this.y += 2, this.x += 1) : this.t < 600 ? (this.y += 2 * Math.cos(this.arc) + 2, this.x -= 1 * Math.sin(this.arc), this.arc += Math.PI / 200) : this.die = 1;
  3034. break;
  3035. case 11:
  3036. this.y += this.t / 10 * Math.cos(this.arc),
  3037. this.x -= this.t / 10 * Math.sin(this.arc),
  3038. 200 == this.t && (this.die = 1);
  3039. break;
  3040. case 12:
  3041. var a = this.x + this.width / 2 - Attack.player.x - 43,
  3042. b = this.y + this.hight / 2 - Attack.player.y - 36,
  3043. c = Math.sqrt(a * a + b * b),
  3044. d = a / c;
  3045. b > 0 ? (this.arc3 = Math.PI - Math.asin(d), Math.abs(Math.asin(d)) < Math.PI ? this.arc < -2 * Math.PI + this.arc3 ? this.arc += Math.PI / 200 : this.arc -= Math.PI / 200 : this.arc < this.arc3 ? this.arc += Math.PI / 200 : this.arc -= Math.PI / 200) : (this.arc3 = Math.asin(d), this.arc < this.arc3 ? this.arc += Math.PI / 300 : this.arc -= Math.PI / 300),
  3046. this.y = 70 + 20 * Math.sin(this.t * Math.PI / 100),
  3047. this.x += 1.2 + Math.sin(this.t * Math.PI / 70),
  3048. this.x > 370 && (this.die = 1);
  3049. break;
  3050. case 13:
  3051. var a = this.x + this.width / 2 - Attack.player.x - 43,
  3052. b = this.y + this.hight / 2 - Attack.player.y - 36,
  3053. c = Math.sqrt(a * a + b * b),
  3054. d = a / c;
  3055. b > 0 ? (this.arc3 = Math.PI - Math.asin(d), Math.abs(Math.asin(d)) < Math.PI ? this.arc < -2 * Math.PI + this.arc3 ? this.arc += Math.PI / 200 : this.arc -= Math.PI / 200 : this.arc < this.arc3 ? this.arc += Math.PI / 200 : this.arc -= Math.PI / 200) : (this.arc3 = Math.asin(d), this.arc < this.arc3 ? this.arc += Math.PI / 300 : this.arc -= Math.PI / 300),
  3056. this.y = 70 + 20 * Math.sin(this.t * Math.PI / 100),
  3057. this.x -= 1.2 + Math.sin(this.t * Math.PI / 70),
  3058. this.x < -100 && (this.die = 1);
  3059. break;
  3060. case 14:
  3061. this.x -= 1 * Math.sin(this.t * Math.PI / 100),
  3062. this.y -= 2 * Math.sin(this.t * Math.PI / 100),
  3063. this.t < 180 && (this.y -= 5 * Math.sin(this.t * Math.PI / 180)),
  3064. this.t > 600 && (this.y -= 6),
  3065. 650 == this.t && (this.die = 1);
  3066. break;
  3067. case 15:
  3068. this.x += Math.sin(this.t * Math.PI / 100),
  3069. this.t < 80 && (this.y -= 8 + Math.cos(this.t * Math.PI / 100)),
  3070. 1 == sj_1 && (this.x -= 3 * Math.sin(this.t * Math.PI / 100), this.y -= Math.cos(this.t * Math.PI / 100)),
  3071. 3 == sj_1 && (this.x += 2 * Math.sin(this.t * Math.PI / 100))
  3072. }
  3073. };
  3074. var Pd = function(a, b, c, d, e, f) {
  3075. this.x = a,
  3076. this.y = b,
  3077. this.t = 0,
  3078. this.w = c,
  3079. this.h = d,
  3080. this.type = e,
  3081. this.arc = f,
  3082. this.kt = random(0, 2),
  3083. this.die = 0,
  3084. this.cos1 = Math.cos(f),
  3085. this.sin1 = Math.sin(f),
  3086. this.d_x = this.x,
  3087. this.d_y = this.y,
  3088. (36 == this.type || 37 == this.type || 38 == this.type || 39 == this.type || 41 == this.type) && (this.x = Attack.player.x + Attack.player.w / 2 + this.d_x)
  3089. };
  3090. Pd.prototype.dr = function() {
  3091. var a = Attack.ctx2;
  3092. switch (this.type) {
  3093. case 1:
  3094. a.save(),
  3095. a.translate(this.x, this.y),
  3096. a.rotate(Math.PI / 18 * (this.t % 36)),
  3097. a.drawImage(Attack.imgDx[12], 12 * (Math.floor(this.kt) % 2), 0, 12, 12, -6, -6, 12, 12),
  3098. a.restore(),
  3099. this.kt += .1;
  3100. break;
  3101. case 2:
  3102. if (this.t > 15) {
  3103. var b = this.x,
  3104. c = this.y,
  3105. d = Math.round(b),
  3106. e = Math.round(c);
  3107. a.save(),
  3108. a.translate(d, e),
  3109. a.rotate(Math.PI - this.arc),
  3110. a.drawImage(Attack.imgDx[41], 10 * (Math.round(this.kt) % 2), 0, 10, 20, -5, -31, 10, 20),
  3111. a.restore(),
  3112. this.kt += .1
  3113. }
  3114. a.save(),
  3115. a.translate(this.x, this.y),
  3116. a.rotate(Math.PI - this.arc),
  3117. a.drawImage(Attack.imgDx[6], -5, -13),
  3118. a.restore();
  3119. break;
  3120. case 8:
  3121. case 5:
  3122. case 29:
  3123. case 7:
  3124. if (a.save(), this.t > 10) {
  3125. var b = this.x,
  3126. c = this.y,
  3127. d = Math.round(b),
  3128. e = Math.round(c);
  3129. a.save(),
  3130. a.translate(d, e),
  3131. a.rotate(Math.PI - this.arc),
  3132. a.drawImage(Attack.imgDx[41], 10 * (Math.round(this.kt) % 2), 0, 10, 20, -5, -26, 10, 20),
  3133. a.restore(),
  3134. this.kt += .1
  3135. }
  3136. a.translate(this.x, this.y),
  3137. a.rotate(Math.PI - this.arc),
  3138. a.drawImage(Attack.imgDx[20], -6, -8, 10, 28),
  3139. a.restore();
  3140. break;
  3141. case 18:
  3142. a.save(),
  3143. a.translate(this.x, this.y),
  3144. a.rotate(Math.PI - this.arc),
  3145. a.drawImage(Attack.imgDx[70], 6 * (Math.round(this.kt) % 2), 0, 6, 18, -2.5, -9, 5, 18),
  3146. a.restore(),
  3147. this.kt += .1;
  3148. break;
  3149. case 4:
  3150. a.save(),
  3151. a.translate(this.x, this.y),
  3152. a.rotate(Math.PI - this.arc),
  3153. a.drawImage(Attack.imgDx[13], 5 * (Math.round(this.kt) % 2), 0, 5, 18, -2.5, -9, 5, 18),
  3154. a.restore(),
  3155. this.kt += .1;
  3156. break;
  3157. case 12:
  3158. a.save(),
  3159. a.translate(this.x, this.y),
  3160. a.rotate(Math.PI - this.arc),
  3161. a.drawImage(Attack.imgDx[57], 21 * (Math.round(this.kt) % 2), 0, 21, 76, -3.5, -12.5, 7, 25),
  3162. a.restore(),
  3163. this.kt += .1;
  3164. break;
  3165. case 23:
  3166. a.save(),
  3167. a.translate(this.x, this.y),
  3168. a.rotate(Math.PI - this.arc),
  3169. a.drawImage(Attack.imgDx[53], 6 * (Math.round(this.kt) % 2), 0, 6, 24, -3, -12, 6, 24),
  3170. a.restore(),
  3171. this.kt += .1;
  3172. break;
  3173. case 25:
  3174. a.save(),
  3175. a.translate(this.x, this.y),
  3176. a.rotate(Math.PI - this.arc),
  3177. a.drawImage(Attack.imgDx[82], 16 * (Math.floor(this.kt) % 2), 0, 16, 16, -8, -8, 16, 16),
  3178. a.restore(),
  3179. this.kt += .1;
  3180. break;
  3181. case 26:
  3182. a.save(),
  3183. a.translate(this.x, this.y),
  3184. a.rotate(Math.PI - this.arc),
  3185. a.drawImage(Attack.imgDx[83], 20 * (Math.floor(this.kt) % 2), 0, 20, 20, -10, -10, 20, 20),
  3186. a.restore(),
  3187. this.kt += .1;
  3188. break;
  3189. case 6:
  3190. a.save(),
  3191. a.translate(this.x, this.y),
  3192. a.rotate(Math.PI / 18 * (this.t % 36)),
  3193. a.drawImage(Attack.imgDx[45], 10 * (Math.floor(this.kt) % 2), 0, 10, 14, -5, -7, 10, 14),
  3194. a.restore(),
  3195. this.kt += .1;
  3196. break;
  3197. case 9:
  3198. a.save(),
  3199. a.translate(this.x, this.y),
  3200. a.drawImage(Attack.imgDx[40], 12 * (Math.round(this.kt) % 2), 0, 12, 12, -6, -6, 12, 12),
  3201. a.restore(),
  3202. this.kt += .1;
  3203. break;
  3204. case 3:
  3205. a.save(),
  3206. a.translate(this.x + this.w / 2, this.y + this.h / 2),
  3207. a.rotate(Math.PI - (this.arc2 || this.arc)),
  3208. a.drawImage(Attack.imgDx[10], 12 * (Math.round(this.kt) % 2), 0, 12, 12, -6, -6, 12, 12),
  3209. a.restore(),
  3210. this.kt += .1;
  3211. break;
  3212. case 10:
  3213. a.save(),
  3214. a.translate(this.x, this.y),
  3215. a.drawImage(Attack.imgDx[36], this.w * (Math.round(this.kt) % 2), 0, this.w, this.h, -this.w / 2, -this.h / 2, this.w, this.h),
  3216. a.restore(),
  3217. this.kt += .1;
  3218. break;
  3219. case 11:
  3220. a.save(),
  3221. a.translate(this.x, this.y),
  3222. a.rotate(Math.PI - (this.arc2 || this.arc)),
  3223. a.drawImage(Attack.imgDx[56], this.w * (Math.round(this.kt) % 2), 0, this.w, this.h, -this.w / 2, -this.h / 2, this.w, this.h),
  3224. a.restore(),
  3225. this.kt += .25;
  3226. break;
  3227. case 17:
  3228. a.save(),
  3229. a.translate(this.x, this.y),
  3230. a.rotate(Math.PI / 18 * (this.t % 36)),
  3231. a.drawImage(Attack.imgDx[67], 12 * (Math.floor(this.kt) % 2), 0, 12, 12, -6, -6, 12, 12),
  3232. a.restore(),
  3233. this.kt += .1;
  3234. break;
  3235. case 13:
  3236. a.save(),
  3237. a.translate(this.x, this.y),
  3238. a.rotate(Math.PI - (this.arc2 || this.arc)),
  3239. a.drawImage(Attack.imgDx[66], this.w * (Math.round(this.kt) % 2), 0, this.w, this.h, -this.w / 2, -this.h / 2, this.w, this.h),
  3240. a.restore(),
  3241. this.kt += 1 / 8;
  3242. break;
  3243. case 19:
  3244. a.save(),
  3245. a.translate(this.x, this.y),
  3246. a.rotate(Math.PI - (this.arc2 || this.arc)),
  3247. a.drawImage(Attack.imgDx[11], this.w * (Math.round(this.kt) % 2), 0, this.w, this.h, -this.w / 2, -this.h / 2, this.w, this.h),
  3248. a.restore(),
  3249. this.kt += .1;
  3250. break;
  3251. case 24:
  3252. a.save(),
  3253. a.translate(this.x + 4, this.y + 11),
  3254. a.rotate(Math.PI - (this.arc2 || this.arc)),
  3255. a.drawImage(Attack.imgDx[47], -3, -10),
  3256. a.restore();
  3257. break;
  3258. case 15:
  3259. a.save(),
  3260. a.translate(this.x, this.y),
  3261. a.rotate(Math.PI - this.arc),
  3262. a.drawImage(Attack.imgDx[7], -this.w / 2, -this.h / 2, this.w, this.h),
  3263. a.restore(),
  3264. this.h < 184 && (this.h += 7);
  3265. break;
  3266. case 14:
  3267. a.save(),
  3268. a.globalCompositeOperation = "lighter",
  3269. a.translate(this.x, this.y),
  3270. a.rotate(Math.PI - this.arc),
  3271. a.drawImage(Attack.imgDx[7], -this.w / 2, -this.h / 2, this.w, this.h),
  3272. a.restore(),
  3273. this.h < 104 && (this.h += 6);
  3274. break;
  3275. case 16:
  3276. a.save(),
  3277. a.translate(this.x, this.y),
  3278. a.globalCompositeOperation = "lighter",
  3279. a.rotate(Math.PI - this.arc),
  3280. a.drawImage(Attack.imgDx[69], -this.w / 2, -this.h / 2, this.w, this.h),
  3281. a.restore(),
  3282. this.h < 124 && (this.h += 6);
  3283. break;
  3284. case 21:
  3285. a.save();
  3286. for (var f = 0; 2 > f; f++) {
  3287. var g = random( - 8, 8),
  3288. h = random( - 2, 2),
  3289. b = this.x + h,
  3290. c = this.y + 16 - 9.5,
  3291. i = c - this.y,
  3292. j = 0,
  3293. d = Math.round(j * Math.cos( - this.arc) - i * Math.sin( - this.arc) + b),
  3294. e = Math.round(j * Math.sin( - this.arc) + i * Math.cos( - this.arc) + c);
  3295. Attack.splist.push(new sp(d, e - 5, 36 + g, this.arc, Attack.imgDx[71], 8))
  3296. }
  3297. break;
  3298. case 28:
  3299. a.save(),
  3300. a.translate(this.x, this.y),
  3301. a.rotate(Math.PI - this.arc),
  3302. a.drawImage(Attack.imgDx[41], -8.5, -27),
  3303. a.restore();
  3304. break;
  3305. case 35:
  3306. a.save(),
  3307. a.translate(this.x, this.y),
  3308. a.rotate(Math.PI - this.arc),
  3309. a.globalCompositeOperation = "lighter",
  3310. a.drawImage(Attack.imgDx[71], -this.w / 2, -this.h / 2, this.w, this.h),
  3311. this.h < 200 && (this.h += 14),
  3312. this.w < 18 && (this.w += 1),
  3313. a.restore();
  3314. break;
  3315. case 36:
  3316. a.save(),
  3317. a.translate(this.x, this.y),
  3318. a.globalCompositeOperation = "lighter",
  3319. a.drawImage(Attack.imgDx[101], -this.w / 2, -this.h / 2, this.w, this.h),
  3320. a.restore();
  3321. break;
  3322. case 37:
  3323. a.save(),
  3324. a.translate(this.x, this.y),
  3325. a.globalCompositeOperation = "lighter",
  3326. a.drawImage(Attack.imgDx[102], -this.w / 2, -this.h / 2, this.w, this.h),
  3327. a.restore();
  3328. break;
  3329. case 38:
  3330. a.save(),
  3331. a.translate(this.x, this.y),
  3332. a.globalCompositeOperation = "lighter",
  3333. a.drawImage(Attack.imgDx[103], -this.w / 2, -this.h / 2, this.w, this.h),
  3334. a.restore();
  3335. break;
  3336. case 39:
  3337. a.save(),
  3338. a.translate(this.x, this.y),
  3339. a.globalCompositeOperation = "lighter",
  3340. a.drawImage(Attack.imgDx[104], -this.w / 2, -this.h / 2, this.w, this.h),
  3341. a.restore();
  3342. break;
  3343. case 40:
  3344. a.save(),
  3345. a.translate(this.x, this.y),
  3346. a.rotate(Math.PI - this.arc),
  3347. a.globalCompositeOperation = "lighter",
  3348. a.drawImage(Attack.imgDx[105], -this.w / 2, -this.h / 2, this.w, this.h),
  3349. this.h < 200 && (this.h += 14),
  3350. this.w < 18 && (this.w += 1),
  3351. a.restore();
  3352. break;
  3353. case 41:
  3354. a.save(),
  3355. a.translate(this.x, this.y),
  3356. a.rotate(Math.PI - this.arc),
  3357. a.globalCompositeOperation = "lighter",
  3358. a.drawImage(Attack.imgDx[106], -this.w / 2, -this.h / 2, this.w, this.h),
  3359. this.h < 300 && (this.h += 16),
  3360. this.w += 4 * Math.sin(Math.PI / 2 + this.t * Math.PI / 8),
  3361. a.restore()
  3362. }
  3363. },
  3364. Pd.prototype.move = function() {
  3365. if (this.y < Attack.pos_y && this.y > -20 && this.x > -20 && this.x < 350) {
  3366. var a = Attack.player; ! a.wd && a.isHit(new OBB(new Vector2(this.x, this.y), this.w, this.h, this.arc)) && (this.die = 1),
  3367. this.run()
  3368. } else this.die = 1
  3369. },
  3370. Pd.prototype.move2 = function() {
  3371. var a = Attack.player;
  3372. if (this.y > 0 && this.y < Attack.pos_y && this.x > -30 && this.x < 350 && a) {
  3373. for (var b = Attack.enemylist,
  3374. c = Attack.tanklist,
  3375. d = 0,
  3376. e = b.length,
  3377. f = c.length,
  3378. g = 0,
  3379. h = new OBB(new Vector2(this.x, this.y), this.w, this.h, this.arc); e > d; d++) if (b[d].isHit(h)) {
  3380. var i = parseInt(Attack.all_mub) + 100 * (1 + a.hit / 100);
  3381. Attack.score_init(i),
  3382. a.htime = 60,
  3383. a.htime > 0 && (a.hit_t++, a.hit_t > 10 && (a.hit++, Attack.hit_init(a.hit), a.hit_t = 0)),
  3384. 2 == this.type && (b[d].blood -= 2),
  3385. 35 != this.type && 41 != this.type && (this.die = 1)
  3386. }
  3387. for (; f > g; g++) if (c[g].isHit(h)) {
  3388. var i = parseInt(Attack.all_mub) + 100 * (1 + a.hit / 100);
  3389. Attack.score_init(i),
  3390. a.htime = 60,
  3391. a.htime > 0 && (a.hit_t++, a.hit_t > 10 && (a.hit++, Attack.hit_init(a.hit), a.hit_t = 0)),
  3392. 2 == this.type && (c[g].blood -= 2),
  3393. 35 != this.type && 41 != this.type && (this.die = 1)
  3394. }
  3395. this.run()
  3396. } else this.die = 1
  3397. },
  3398. Pd.prototype.run = function() {
  3399. switch (this.type) {
  3400. case 1:
  3401. var a = Attack.player;
  3402. if (this.t < 3) {
  3403. var b = this.x + this.w / 2 - a.x - 20,
  3404. c = this.y + this.h / 2 - a.y - 25,
  3405. d = Math.sqrt(b * b + c * c);
  3406. this.sin1 = b / d,
  3407. this.cos1 = c / d,
  3408. this.arc2 = c > 0 ? Math.asin(this.sin1) : Math.PI - Math.asin(this.sin1)
  3409. }
  3410. this.t++,
  3411. this.y -= 3 * this.cos1,
  3412. this.x -= 3 * this.sin1;
  3413. break;
  3414. case 2:
  3415. if (0 == this.t) {
  3416. var e = random(0, Attack.enemylist.length);
  3417. this._player = Attack.enemylist[e]
  3418. }
  3419. if (this._player) {
  3420. if (this._player.die) this.y -= (1 + this.t / 10) * Math.cos(this.arc),
  3421. this.x -= (1 + this.t / 10) * Math.sin(this.arc);
  3422. else if (this.t < 10) this.arc = this.arc,
  3423. this.y -= this.t * Math.cos(this.arc),
  3424. this.x -= this.t * Math.sin(this.arc);
  3425. else if (this.t < 15) this.y -= 1 * Math.cos(this.arc),
  3426. this.x -= 1 * Math.sin(this.arc);
  3427. else if (this.t < 180) {
  3428. var b = this.x - this._player.x - this._player.width / 2,
  3429. c = this.y - this._player.y - this._player.hight / 2,
  3430. d = Math.sqrt(b * b + c * c);
  3431. this.sin1 = b / d,
  3432. c > 0 ? (this.arc3 = Math.asin(this.sin1), this.arc < this.arc3 ? this.arc += Math.PI / 40 : this.arc -= Math.PI / 40) : (this.arc3 = this.x > Attack.player.x + 43 ? -Math.PI - Math.asin(this.sin1) : Math.PI - Math.asin(this.sin1), this.arc < this.arc3 ? this.arc += Math.PI / 40 : this.arc -= Math.PI / 40),
  3433. this.y -= (1 + this.t / 10) * Math.cos(this.arc),
  3434. this.x -= (1 + this.t / 10) * Math.sin(this.arc)
  3435. }
  3436. } else this.t < 10 ? (this.arc = this.arc, this.y -= this.t * Math.cos(this.arc), this.x -= this.t * Math.sin(this.arc)) : this.t < 15 ? (this.y -= 1 * Math.cos(this.arc), this.x -= 1 * Math.sin(this.arc)) : (this.x > Attack.player.x + 43 ? this.t < 40 && (this.arc += Math.PI / 100) : this.t < 40 && (this.arc -= Math.PI / 100), this.y -= (1 + this.t / 10) * Math.cos(this.arc), this.x -= (1 + this.t / 10) * Math.sin(this.arc));
  3437. this.t++;
  3438. break;
  3439. case 7:
  3440. var a = Attack.player;
  3441. if (this.t < 10) {
  3442. var b = this.x - a.x - 20,
  3443. c = this.y - a.y - 25,
  3444. d = Math.sqrt(b * b + c * c);
  3445. this.sin1 = b / d,
  3446. this.cos1 = c / d,
  3447. this.arc = Math.PI,
  3448. this.x -= -4
  3449. } else if (this.t < 15);
  3450. else if (this.t < 70) {
  3451. var b = this.x - a.x - 20,
  3452. c = this.y - a.y - 25,
  3453. d = Math.sqrt(b * b + c * c);
  3454. this.sin1 = b / d,
  3455. c > 0 ? (this.arc3 = Math.asin(this.sin1), this.arc < this.arc3 ? this.arc += Math.PI / 40 : this.arc -= Math.PI / 40) : (this.arc3 = Math.PI - Math.asin(this.sin1), this.arc < this.arc3 ? this.arc += Math.PI / 40 : this.arc -= Math.PI / 40),
  3456. this.y -= this.t / 15 * Math.cos(this.arc),
  3457. this.x -= this.t / 15 * Math.sin(this.arc)
  3458. } else this.y -= this.t / 15 * Math.cos(this.arc),
  3459. this.x -= this.t / 15 * Math.sin(this.arc);
  3460. this.t++;
  3461. break;
  3462. case 8:
  3463. var a = Attack.player;
  3464. if (this.t < 10) {
  3465. var b = this.x - a.x - 43,
  3466. c = this.y - a.y - 36,
  3467. d = Math.sqrt(b * b + c * c);
  3468. this.sin1 = b / d,
  3469. this.cos1 = c / d,
  3470. this.arc = Math.PI,
  3471. this.x -= 4
  3472. } else if (this.t < 15);
  3473. else if (this.t < 70) {
  3474. var b = this.x - a.x - 20,
  3475. c = this.y - a.y - 25,
  3476. d = Math.sqrt(b * b + c * c);
  3477. this.sin1 = b / d,
  3478. c > 0 ? (this.arc3 = 2 * Math.PI + Math.asin(this.sin1), this.arc < this.arc3 ? this.arc += Math.PI / 40 : this.arc -= Math.PI / 40) : (this.arc3 = Math.PI - Math.asin(this.sin1), this.arc < this.arc3 ? this.arc += Math.PI / 40 : this.arc -= Math.PI / 40),
  3479. this.y -= this.t / 15 * Math.cos(this.arc),
  3480. this.x -= this.t / 15 * Math.sin(this.arc)
  3481. } else this.y -= this.t / 15 * Math.cos(this.arc),
  3482. this.x -= this.t / 15 * Math.sin(this.arc);
  3483. this.t++;
  3484. break;
  3485. case 3:
  3486. var a = Attack.player;
  3487. if (this.t < 3) {
  3488. var b = this.x + this.w / 2 - a.x - 20,
  3489. c = this.y + this.h / 2 - a.y - 25,
  3490. d = Math.sqrt(b * b + c * c);
  3491. this.sin1 = b / d,
  3492. this.cos1 = c / d,
  3493. this.arc2 = c > 0 ? Math.asin(this.sin1) : Math.PI - Math.asin(this.sin1)
  3494. }
  3495. this.y -= this.speed * this.cos1,
  3496. this.x -= this.speed * this.sin1,
  3497. this.t++;
  3498. break;
  3499. case 19:
  3500. this.y -= this.speed * this.cos1,
  3501. this.x -= this.speed * this.sin1,
  3502. this.t++;
  3503. break;
  3504. case 21:
  3505. if (0 == this.t) {
  3506. var e = random(0, Attack.enemylist.length);
  3507. this._player = Attack.enemylist[e]
  3508. }
  3509. if (this._player) {
  3510. if (this._player.die) this.y -= (8 + this.t / 15) * Math.cos(this.arc),
  3511. this.x -= (8 + this.t / 15) * Math.sin(this.arc);
  3512. else if (this.t < 15);
  3513. else if (this.t < 180) {
  3514. var b = this.x - this._player.x - this._player.width / 2,
  3515. c = this.y - this._player.y - this._player.hight / 2,
  3516. d = Math.sqrt(b * b + c * c);
  3517. this.sin1 = b / d,
  3518. c > 0 ? (this.arc3 = Math.asin(this.sin1), this.arc < this.arc3 ? this.arc += Math.PI / 30 : this.arc -= Math.PI / 30) : (this.arc3 = this.x > Attack.player.x + 43 ? -Math.PI - Math.asin(this.sin1) : Math.PI - Math.asin(this.sin1), this.arc < this.arc3 ? this.arc += Math.PI / 30 : this.arc -= Math.PI / 30),
  3519. this.y -= (8 + this.t / 15) * Math.cos(this.arc),
  3520. this.x -= (8 + this.t / 15) * Math.sin(this.arc)
  3521. }
  3522. } else this.t < 15 || (this.x > Attack.player.x + 43 ? this.t < 50 && (this.arc += Math.PI / 40) : this.t < 50 && (this.arc -= Math.PI / 40), this.y -= (8 + this.t / 15) * Math.cos(this.arc), this.x -= (8 + this.t / 15) * Math.sin(this.arc));
  3523. this.t++;
  3524. break;
  3525. case 18:
  3526. case 4:
  3527. this.y -= this.speed * this.cos1,
  3528. this.x -= this.speed * this.sin1,
  3529. this.t++;
  3530. break;
  3531. case 11:
  3532. if (this.t < 20) this.y -= 3 * this.cos1,
  3533. this.x -= 3 * this.sin1;
  3534. else if (35 == this.t) {
  3535. for (var f = 0; 10 > f; f++) {
  3536. var g = new Pd(this.x, this.y, 0, 0, 12, Math.PI / 5 * f);
  3537. g.sin1 = Math.sin(Math.PI / 5 * f),
  3538. g.cos1 = Math.cos(Math.PI / 5 * f),
  3539. Attack.drDpd.push(g)
  3540. }
  3541. this.die = 1
  3542. }
  3543. this.t++;
  3544. break;
  3545. case 6:
  3546. this.y -= this.speed * this.cos1,
  3547. this.x -= this.speed * this.sin1,
  3548. this.t++;
  3549. break;
  3550. case 9:
  3551. this.y -= this.speed * this.cos1,
  3552. this.x -= this.speed * this.sin1,
  3553. this.t++;
  3554. break;
  3555. case 10:
  3556. this.y -= (10 - 7 * Math.sin(Math.PI * this.t / 120)) * this.cos1,
  3557. this.x -= (10 - 7 * Math.sin(Math.PI * this.t / 120)) * this.sin1,
  3558. this.t++;
  3559. break;
  3560. case 13:
  3561. this.y -= this.speed * this.cos1,
  3562. this.x -= this.speed * this.sin1;
  3563. break;
  3564. case 26:
  3565. this.y -= this.speed * this.cos1,
  3566. this.x -= this.speed * this.sin1;
  3567. break;
  3568. case 12:
  3569. this.y -= (9 - 7 * Math.sin(Math.PI * this.t / 120)) * this.cos1,
  3570. this.x -= (9 - 7 * Math.sin(Math.PI * this.t / 120)) * this.sin1,
  3571. this.t++;
  3572. break;
  3573. case 23:
  3574. this.y -= this.speed * this.cos1,
  3575. this.x -= this.speed * this.sin1,
  3576. this.t++;
  3577. break;
  3578. case 25:
  3579. this.y -= (this.speed + this.t / 15) * this.cos1,
  3580. this.x -= (this.speed + this.t / 15) * this.sin1,
  3581. this.t++;
  3582. break;
  3583. case 17:
  3584. this.y -= 3 * this.cos1,
  3585. this.x -= 3 * this.sin1,
  3586. this.t++;
  3587. break;
  3588. case 5:
  3589. var a = Attack.player;
  3590. if (this.t < 10) this.y += 2;
  3591. else if (this.t < 40) {
  3592. var b = this.x - a.x - 20,
  3593. c = this.y - a.y - 25,
  3594. d = Math.sqrt(b * b + c * c);
  3595. this.sin1 = b / d,
  3596. c > 0 ? (this.arc3 = Math.asin(this.sin1), this.arc < this.arc3 ? this.arc += Math.PI / 40 : this.arc -= Math.PI / 40) : (this.arc3 = Math.PI - Math.asin(this.sin1), this.arc < this.arc3 ? this.arc += Math.PI / 40 : this.arc -= Math.PI / 40),
  3597. this.y -= (2 + this.t / 15) * Math.cos(this.arc),
  3598. this.x -= (2 + this.t / 15) * Math.sin(this.arc)
  3599. } else this.y -= (2 + this.t / 15) * Math.cos(this.arc),
  3600. this.x -= (2 + this.t / 15) * Math.sin(this.arc);
  3601. this.t++;
  3602. break;
  3603. case 29:
  3604. var a = Attack.player;
  3605. if (this.t < 10) this.y -= 2 * Math.cos(this.arc),
  3606. this.x -= 2 * Math.sin(this.arc);
  3607. else if (this.t < 40) {
  3608. var b = this.x - a.x - 20,
  3609. c = this.y - a.y - 25,
  3610. d = Math.sqrt(b * b + c * c);
  3611. this.sin1 = b / d,
  3612. c > 0 ? (this.arc3 = Math.asin(this.sin1), this.arc < this.arc3 ? this.arc += Math.PI / 40 : this.arc -= Math.PI / 40) : (this.arc3 = Math.PI - Math.asin(this.sin1), this.arc < this.arc3 ? this.arc += Math.PI / 40 : this.arc -= Math.PI / 40),
  3613. this.y -= (2 + this.t / 15) * Math.cos(this.arc),
  3614. this.x -= (2 + this.t / 15) * Math.sin(this.arc)
  3615. } else this.y -= (2 + this.t / 15) * Math.cos(this.arc),
  3616. this.x -= (2 + this.t / 15) * Math.sin(this.arc);
  3617. this.t++;
  3618. break;
  3619. case 24:
  3620. this.t++,
  3621. this.t < 15 ? (this.y -= Math.round(3 * this.cos1), this.x -= Math.round(3 * this.sin1)) : (this.y -= Math.round(7 * this.cos1), this.x -= Math.round(7 * this.sin1));
  3622. break;
  3623. case 14:
  3624. this.y -= (7 + this.t) * Math.cos(this.arc),
  3625. this.x -= (7 + this.t) * Math.sin(this.arc),
  3626. this.t++;
  3627. break;
  3628. case 15:
  3629. this.y -= this.t / 3 * Math.cos(this.arc),
  3630. this.x -= this.t / 3 * Math.sin(this.arc),
  3631. this.t++;
  3632. break;
  3633. case 28:
  3634. this.y -= (7 + this.t) * this.cos1,
  3635. this.x -= (7 + this.t) * this.sin1,
  3636. this.t++;
  3637. break;
  3638. case 16:
  3639. this.y -= (3 + this.t) * this.cos1,
  3640. this.x -= (3 + this.t) * this.sin1,
  3641. this.t++;
  3642. break;
  3643. case 35:
  3644. this.t > 3 && (this.y -= 1.8 * this.t * this.cos1, this.x -= 1.8 * this.t * this.sin1),
  3645. this.t++;
  3646. break;
  3647. case 36:
  3648. case 37:
  3649. this.y -= (7 + this.t) * Math.cos(this.arc),
  3650. this.x -= (7 + this.t) * Math.sin(this.arc),
  3651. this.x = Attack.player.x + Attack.player.w / 2 + this.d_x,
  3652. this.t++;
  3653. break;
  3654. case 38:
  3655. case 39:
  3656. this.y -= (7 + this.t) * Math.cos(this.arc),
  3657. this.x -= (7 + this.t) * Math.sin(this.arc),
  3658. this.x = Attack.player.x + Attack.player.w / 2 + this.d_x,
  3659. this.t++;
  3660. break;
  3661. case 40:
  3662. this.y -= (12 + this.t) * this.cos1,
  3663. this.x -= (12 + this.t) * this.sin1,
  3664. this.t++;
  3665. break;
  3666. case 41:
  3667. 0 == this.t && (this.d_y = -this.h / 2),
  3668. this.d_y -= this.t * Math.cos(this.arc),
  3669. this.d_x -= this.t * Math.sin(this.arc),
  3670. this.y = Attack.player.y + 10 + this.d_y,
  3671. this.x = Attack.player.x + Attack.player.w / 2 + this.d_x,
  3672. this.t++
  3673. }
  3674. },
  3675. bomb.prototype.dr = function() {
  3676. if (Attack.ctx2, this.j <= 60) {
  3677. var d = random(0, 10);
  3678. 0 == this.j % 4 && (Attack.player.fire(Attack.player.x + 43 - 10, Attack.player.y + 40, 0, 0, 16, d * Math.PI / 30), Attack.player.fire(Attack.player.x + 44 + 10, Attack.player.y + 40, 0, 0, 16, -d * Math.PI / 30))
  3679. } else if (this.j > 60 && this.j <= 420 && (61 == this.j && (gameDiv.className = "gameOn"), 0 == this.j % 2)) {
  3680. var e = random( - 32, 32),
  3681. f = random( - 32, 32);
  3682. Attack.bzlist.push(new explode(this.x + 5 * e, this.y + 5 * f, 1));
  3683. for (var g = 0; 10 > g; g++) {
  3684. var h = random( - 40, 40);
  3685. Attack.splist.push(new sp(this.x + 5 * e, this.y + 5 * f, 55 + h, Math.PI / 6 * g + h * Math.PI / 100, Attack.imgDx[16], 1))
  3686. }
  3687. }
  3688. },
  3689. bomb.prototype.run = function() {
  3690. this.j <= 60 ? this.y -= 5 : this.j > 60 && this.j <= 420 && this.bz(),
  3691. this.j++
  3692. },
  3693. bomb.prototype.bz = function() {
  3694. for (var a = 0; a < Attack.enemylist.length; a++) 0 == this.j % 4 && Attack.enemylist[a].bzd(this.x, this.y, 140) && (Attack.player.score += 100, Attack.enemylist[a].blood <= 0 && (Attack.enemylist.die = 1))
  3695. },
  3696. stage.prototype.drBg = function() {
  3697. for (var a = 0; a < Attack.s.length; a++) Attack.s[a].die && Attack.s.splice(a, 1);
  3698. for (var a = 0; a < Attack.chenaList.length; a++) Attack.chenaList[a].die && Attack.chenaList.splice(a, 1);
  3699. if (10 == this.t) {
  3700. var b = Attack.createrBtn(this.title[Attack.stageI], 480, Attack.pos_y / 2 - 60, 1);
  3701. b.to({
  3702. x: 160
  3703. },
  3704. 30, "Back", "easeOut", 0,
  3705. function() {
  3706. b.to({
  3707. x: -160,
  3708. alpha: 0
  3709. },
  3710. 30, "Back", "easeIn", 20,
  3711. function() {
  3712. b.remove()
  3713. })
  3714. }),
  3715. Attack.easyGameList.push(b)
  3716. }
  3717. this.dn3 += this.speed,
  3718. this.dn4 += this.speed,
  3719. this.dn3 >= 570 && (this.dn3 -= 1140),
  3720. this.dn4 >= 570 && (this.dn4 -= 1140);
  3721. var c = Attack.ctx2;
  3722. c.drawImage(this.img, 0, this.dn3),
  3723. c.drawImage(this.img, 0, this.dn4);
  3724. for (var a = 0; a < Attack.s.length; a++) Attack.s[a].run(),
  3725. Attack.s[a].dr();
  3726. for (var a = 0; a < Attack.chenaList.length; a++) Attack.chenaList[a].move(),
  3727. Attack.chenaList[a].dr();
  3728. Attack.over_t || (this.t += .5)
  3729. };
  3730. var a_mub = function(a, b, c, d, e, f) {
  3731. this.n = c,
  3732. this.x = b,
  3733. this.h = e,
  3734. this.speed = e / d,
  3735. this.a = a,
  3736. this.y = 4 * -this.h,
  3737. this.nub = [],
  3738. this.c = f,
  3739. this.init()
  3740. };
  3741. a_mub.prototype.init = function() {
  3742. this.nub[5] = this.a;
  3743. for (var a = 6; 10 > a; a++) this.nub[a] = 0 == this.nub[a - 1] ? 9 : this.nub[a - 1] - 1;
  3744. for (var a = 4; a >= 0; a--) this.nub[a] = 9 == this.nub[a + 1] ? 0 : this.nub[a + 1] + 1
  3745. },
  3746. a_mub.prototype.dr = function() {
  3747. var a = this.c;
  3748. if (a.save(), this.c == Attack.ctx3) for (var b = 0; b < this.nub.length; b++) {
  3749. var c = this.y + (b - 1) * this.h;
  3750. c > -60 && 60 > c && a.drawImage(Attack.imgDx[85 + this.nub[b]], this.x, c, 12, 24)
  3751. } else for (var b = 0; b < this.nub.length; b++) {
  3752. var c = this.y + (b - 1) * this.h;
  3753. c > -100 && 210 > c && a.drawImage(Attack.imgDx[85 + this.nub[b]], this.x, c)
  3754. }
  3755. a.restore()
  3756. },
  3757. a_mub.prototype.move = function() {
  3758. if (this.n != this.nub[5] && (this.y += this.speed, 4 * this.h + this.y >= this.h)) {
  3759. var a = this.nub.pop();
  3760. this.nub.splice(0, 0, a),
  3761. this.y = 4 * -this.h
  3762. }
  3763. },
  3764. explode.prototype.dr = function() {
  3765. var a = Attack.ctx2;
  3766. switch (this.type) {
  3767. case 1:
  3768. a.drawImage(Attack.imgDx[17], 82 * Math.floor(this.r / 2), 0, 82, 68, this.x - 41, this.y - 34 - this.r, 82, 68);
  3769. break;
  3770. case 2:
  3771. if (0 == this.t % 2) {
  3772. var b = random( - 22, 22),
  3773. c = random( - 22, 22);
  3774. Attack.bzlist.push(new explode(this.x + 5 * b, this.y + 5 * c, 5))
  3775. }
  3776. break;
  3777. case 3:
  3778. if (0 == this.t % 2) {
  3779. var b = random( - 22, 22),
  3780. c = random( - 22, 22);
  3781. Attack.bzlist.push(new explode(this.x + 5 * b, this.y + 5 * c, 5))
  3782. }
  3783. break;
  3784. case 4:
  3785. a.drawImage(Attack.imgDx[17], 82 * Math.floor(this.r / 2), 0, 82, 68, this.x - 41, this.y - 34 - this.r, 82, 68);
  3786. var d = 10 * this.t;
  3787. a.drawImage(Attack.imgDx[42], this.x - d / 2, this.y - d / 2, d, d);
  3788. break;
  3789. case 5:
  3790. a.drawImage(Attack.imgDx[17], 82 * Math.floor(this.r / 2), 0, 82, 68, this.x - 41, this.y - 34 - this.r, 82, 68);
  3791. var d = 10 * this.t;
  3792. a.drawImage(Attack.imgDx[42], this.x - d / 2, this.y - d / 2, d, d)
  3793. }
  3794. this.t++
  3795. },
  3796. explode.prototype.bao = function(a) {
  3797. switch (this.type) {
  3798. case 1:
  3799. this.r < 28 ? this.r++:this.die = 1;
  3800. break;
  3801. case 2:
  3802. if (1 == this.t) for (var a = 0; a < Attack.enemylist.length; a++) Attack.enemylist[a].die = 1;
  3803. Attack.player.wd = 2,
  3804. 60 == this.t && (this.die = 1, Attack.result());
  3805. break;
  3806. case 3:
  3807. 40 == this.t && (this.die = 1, Attack.over_t = 0);
  3808. break;
  3809. case 4:
  3810. this.r < 28 ? this.r++:(Attack.over_t = 1, Attack.player.wd = 2, Attack.gameover(), Attack.stage.t = 0, this.die = 1);
  3811. break;
  3812. case 5:
  3813. this.r < 28 ? this.r++:this.die = 1
  3814. }
  3815. },
  3816. sp.prototype.dr = function() {
  3817. var a = Attack.ctx2;
  3818. 1 == this.type && a.drawImage(this.img, this.x - this.h / 2, this.y - this.h / 2, this.h, this.h),
  3819. 2 == this.type && (a.save(), a.globalAlpha = .7, a.drawImage(this.img, Attack.player.x + Attack.player.w / 2 - this.h / 2 + this.m, this.y + 20 - 4 * this.h - this.n, this.h, 6 * this.h), a.restore()),
  3820. 3 == this.type && a.drawImage(this.img, this.x - this.h / 2 + this.m, this.y - this.h / 2 - this.n, this.h, this.h),
  3821. 4 == this.type && a.drawImage(this.img, this.x - this.h / 2, this.y - this.h / 2, this.h, this.h),
  3822. 5 == this.type && a.drawImage(this.img, 0, 0, 64, 64, Attack.player.x + 31 - this.h / 2, this.y + 30 - 4 * this.h, this.h, 4 * this.h),
  3823. 6 == this.type && a.drawImage(this.img, this.x - this.h / 2, this.y - this.h / 2, this.h, this.h),
  3824. 7 == this.type && (a.save(), a.globalAlpha = .7, a.drawImage(this.img, Attack.player.x + Attack.player.w / 2 - this.h / 2, this.y + 70 - 10 * this.h, this.h, 10 * this.h), a.restore()),
  3825. 8 == this.type && a.drawImage(this.img, this.x - this.h / 2, this.y - this.h / 2, this.h, this.h)
  3826. },
  3827. sp.prototype.bao = function() {
  3828. this.h > 0 && this.y > -10 && this.y < 640 ? (1 == this.type && (this.y -= 3 * this.cos1, this.x -= 3 * this.sin1, this.h -= 2), 2 == this.type && (this.y -= 20 * this.cos1, this.x -= 20 * this.sin1), 3 == this.type && (this.y -= 2 * this.cos1, this.x -= 2 * this.sin1, this.h -= 1), 4 == this.type && (this.y += 3 * this.cos1, this.x += 3 * this.sin1, this.h -= 3), 8 == this.type && (this.y += 3 * this.cos1, this.x += 3 * this.sin1, this.h -= 3), 6 == this.type && (this.y += 8 * this.cos1, this.x += 8 * this.sin1, this.h -= 1), 7 == this.type && (this.y -= 26 * this.cos1, this.x -= 26 * this.sin1)) : this.die = 1
  3829. },
  3830. chena.prototype.dr = function() {
  3831. var a = Attack.ctx2;
  3832. a.save(),
  3833. a.translate(this.x + this.width / 2 + 3, this.y + this.hight / 2 + 3),
  3834. a.rotate(this.arc),
  3835. a.globalAlpha = .7,
  3836. a.drawImage(this.img, this.width, 0, this.width, this.hight, -this.width / 2, -this.hight / 2, this.width, this.hight),
  3837. a.restore(),
  3838. a.save(),
  3839. a.translate(this.x + this.width / 2, this.y + this.hight / 2),
  3840. a.rotate(this.arc),
  3841. a.drawImage(this.img, 0, 0, this.width, this.hight, -this.width / 2, -this.hight / 2, this.width, this.hight),
  3842. a.restore()
  3843. },
  3844. chena.prototype.move = function() {
  3845. 1 == this.mfx && (this.y += Attack.stage.speed, this.y > 800 && (this.die = 1))
  3846. },
  3847. yun.prototype.dr = function() {
  3848. Attack.ctx2.drawImage(this.img, this.x, this.y)
  3849. },
  3850. yun.prototype.run = function() {
  3851. this.type ? (this.y += 1, this.y > 640 && (this.die = 1)) : (0 == this.fx && (this.y += this.speed_y, this.x -= this.speed_x), 1 == this.fx && (this.y += this.speed_y, this.x += this.speed_x), 2 == this.fx && (this.y += this.speed_y, this.x += this.speed_x), 3 == this.fx && (this.y += this.speed_y, this.x += this.speed_x), this.y > 800 && (this.die = 1))
  3852. },
  3853. star.prototype.dr = function() {
  3854. Attack.ctx2.drawImage(this.img, 30 * (Math.floor(this.st / 4) % 6), 0, 30, 30, this.x - 15, this.y - 15, 30, 30),
  3855. this.st++
  3856. },
  3857. star.prototype.move = function() {
  3858. if (Attack.player.eat(this.x + 15, this.y + 15, 100)) {
  3859. var a = this.x - Attack.player.x - 33,
  3860. b = this.y - Attack.player.y - 25,
  3861. c = Math.sqrt(a * a + b * b),
  3862. d = a / c,
  3863. e = b / c;
  3864. this.y -= 7 * e,
  3865. this.x -= 7 * d
  3866. } else this.y -= this.st / 150 * Math.cos(this.st * Math.PI / 180),
  3867. this.x -= this.st / 150 * Math.sin(this.st * Math.PI / 180);
  3868. if ((this.x > 400 || this.x < -80 || this.y < -80 || this.y > Attack.pos_y + 80) && (this.die = 1), Attack.player.eat(this.x + 15, this.y + 15, 30)) {
  3869. var f;
  3870. if (1 == this.type) {
  3871. Attack.player.blood++,
  3872. f = Attack.imgDx[78];
  3873. var g = Attack.createrBtn(f, Attack.player.y, Attack.player.x + Attack.player.w / 2, 1);
  3874. g.update = function() {
  3875. this.ct++,
  3876. this.x = Attack.player.x + Attack.player.w / 2,
  3877. this.y = Attack.player.y - this.ct
  3878. },
  3879. g.to({
  3880. alpha: 0
  3881. },
  3882. 30, "Back", "easeIn", 5,
  3883. function() {
  3884. g.die = 1
  3885. }),
  3886. Attack.easyGameList.push(g)
  3887. } else if (2 == this.type) {
  3888. if (Attack.player.power < 10) {
  3889. Attack.player.power++,
  3890. Attack.player.t = 1,
  3891. f = Attack.imgDx[76];
  3892. var g = Attack.createrBtn(f, Attack.player.y, Attack.player.x + Attack.player.w / 2, 1);
  3893. g.update = function() {
  3894. this.ct++,
  3895. this.x = Attack.player.x + Attack.player.w / 2,
  3896. this.y = Attack.player.y - this.ct
  3897. },
  3898. g.to({
  3899. alpha: 0
  3900. },
  3901. 30, "Back", "easeIn", 5,
  3902. function() {
  3903. g.die = 1
  3904. }),
  3905. Attack.easyGameList.push(g)
  3906. }
  3907. } else if (3 == this.type && Attack.player.dd < 8) {
  3908. Attack.player.dd++,
  3909. f = Attack.imgDx[80];
  3910. var g = Attack.createrBtn(f, Attack.player.y, Attack.player.x + Attack.player.w / 2, 1);
  3911. g.update = function() {
  3912. this.ct++,
  3913. this.x = Attack.player.x + Attack.player.w / 2,
  3914. this.y = Attack.player.y - this.ct
  3915. },
  3916. g.to({
  3917. alpha: 0
  3918. },
  3919. 30, "Back", "easeIn", 5,
  3920. function() {
  3921. g.die = 1
  3922. }),
  3923. Attack.easyGameList.push(g)
  3924. }
  3925. this.die = 1
  3926. }
  3927. };
  3928. var OBB = function(a, b, c, d) {
  3929. this.centerPoint = a,
  3930. this.extents = [b / 2, c / 2],
  3931. this.axes = [new Vector2(Math.cos(d), Math.sin(d)), new Vector2( - 1 * Math.sin(d), Math.cos(d))],
  3932. this._width = b,
  3933. this._height = c,
  3934. this._rotation = d
  3935. };
  3936. OBB.prototype = {
  3937. getProjectionRadius: function(a) {
  3938. return this.extents[0] * Math.abs(a.dot(this.axes[0])) + this.extents[1] * Math.abs(a.dot(this.axes[1]))
  3939. }
  3940. },
  3941. Vector2 = function(a, b) {
  3942. this.x = a || 0,
  3943. this.y = b || 0
  3944. },
  3945. Vector2.prototype = {
  3946. sub: function(a) {
  3947. return new Vector2(this.x - a.x, this.y - a.y)
  3948. },
  3949. dot: function(a) {
  3950. return this.x * a.x + this.y * a.y
  3951. }
  3952. };
  3953. var CollisionDetector = {
  3954. detectorOBBvsOBB: function(a, b) {
  3955. var c = a.centerPoint.sub(b.centerPoint),
  3956. d = a.axes[0];
  3957. if (a.getProjectionRadius(d) + b.getProjectionRadius(d) <= Math.abs(c.dot(d))) return ! 1;
  3958. var e = a.axes[1];
  3959. if (a.getProjectionRadius(e) + b.getProjectionRadius(e) <= Math.abs(c.dot(e))) return ! 1;
  3960. var f = b.axes[0];
  3961. if (a.getProjectionRadius(f) + b.getProjectionRadius(f) <= Math.abs(c.dot(f))) return ! 1;
  3962. var g = b.axes[1];
  3963. return a.getProjectionRadius(g) + b.getProjectionRadius(g) <= Math.abs(c.dot(g)) ? !1 : !0
  3964. }
  3965. },
  3966. $ = function(a) {
  3967. return document.getElementById(a)
  3968. };
  3969. window.requestAnimFrame = function() {
  3970. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
  3971. function(a) {
  3972. window.setTimeout(a, 1e3 / 60)
  3973. }
  3974. } (),
  3975. window.cancelAFrame = function() {
  3976. return window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame ||
  3977. function(a) {
  3978. window.clearTimeout(a)
  3979. }
  3980. } ();
  3981. var stage2 = function(a) {
  3982. switch (a) {
  3983. case 30:
  3984. enemyZc3(6);
  3985. break;
  3986. case 60:
  3987. enemyZc(6);
  3988. break;
  3989. case 110:
  3990. enemyZc3(6);
  3991. break;
  3992. case 150:
  3993. enemyZc(6);
  3994. break;
  3995. case 189:
  3996. crPt4(200, -100),
  3997. crPt3(270, -190);
  3998. break;
  3999. case 190:
  4000. enemyZc(7);
  4001. break;
  4002. case 248:
  4003. case 268:
  4004. case 288:
  4005. sBossZc2();
  4006. break;
  4007. case 330:
  4008. enemyZc3(7);
  4009. break;
  4010. case 350:
  4011. enemyZc(8);
  4012. break;
  4013. case 417:
  4014. crPt5();
  4015. break;
  4016. case 490:
  4017. crPt5();
  4018. break;
  4019. case 406:
  4020. case 416:
  4021. case 426:
  4022. case 436:
  4023. sBossZc6();
  4024. break;
  4025. case 476:
  4026. case 486:
  4027. case 496:
  4028. case 506:
  4029. sBossZc6_2();
  4030. break;
  4031. case 536:
  4032. case 546:
  4033. case 556:
  4034. case 566:
  4035. case 576:
  4036. sBossZc6();
  4037. break;
  4038. case 530:
  4039. crPt3(140, -100),
  4040. crPt3(170, -50);
  4041. break;
  4042. case 560:
  4043. crPt4(190, -100);
  4044. break;
  4045. case 680:
  4046. crPt4(150, -60),
  4047. crPt3(200, -170);
  4048. break;
  4049. case 726:
  4050. case 736:
  4051. case 746:
  4052. case 756:
  4053. sBossZc6();
  4054. break;
  4055. case 790:
  4056. crPt4(270, -140),
  4057. crPt3(200, -60);
  4058. break;
  4059. case 511:
  4060. case 541:
  4061. case 571:
  4062. case 601:
  4063. sBossZc12();
  4064. break;
  4065. case 806:
  4066. case 816:
  4067. case 836:
  4068. case 846:
  4069. case 856:
  4070. case 866:
  4071. case 876:
  4072. sBossZc6_2();
  4073. break;
  4074. case 880:
  4075. crPt6(210, -100);
  4076. break;
  4077. case 921:
  4078. case 951:
  4079. case 981:
  4080. case 1011:
  4081. sBossZc2();
  4082. break;
  4083. case 941:
  4084. case 971:
  4085. case 1001:
  4086. case 1031:
  4087. case 1061:
  4088. sBossZc12();
  4089. break;
  4090. case 1101:
  4091. enemyZc(6);
  4092. break;
  4093. case 1145:
  4094. enemyZc3(6);
  4095. break;
  4096. case 1142:
  4097. case 1212:
  4098. case 1224:
  4099. case 1236:
  4100. case 1248:
  4101. case 1260:
  4102. sBossZc5();
  4103. break;
  4104. case 1301:
  4105. enemyZc(7);
  4106. break;
  4107. case 1345:
  4108. enemyZc3(7);
  4109. break;
  4110. case 1380:
  4111. crPt7(190, -50);
  4112. break;
  4113. case 1400:
  4114. crPt7(230, -50);
  4115. break;
  4116. case 1420:
  4117. crPt7(160, -50);
  4118. break;
  4119. case 1440:
  4120. crPt7(34, -50);
  4121. break;
  4122. case 1460:
  4123. crPt7(274, -50);
  4124. break;
  4125. case 1480:
  4126. crPt7(174, -50);
  4127. break;
  4128. case 1500:
  4129. crPt7(34, -50);
  4130. break;
  4131. case 1531:
  4132. enemyZc(7);
  4133. break;
  4134. case 1576:
  4135. case 1586:
  4136. case 1596:
  4137. case 1606:
  4138. sBossZc6_2();
  4139. break;
  4140. case 1616:
  4141. case 1626:
  4142. case 1636:
  4143. case 1646:
  4144. case 1656:
  4145. sBossZc6(),
  4146. sBossZc6_3(100);
  4147. break;
  4148. case 1731:
  4149. enemyZc();
  4150. break;
  4151. case 1705:
  4152. enemyZc3();
  4153. break;
  4154. case 1675:
  4155. enemyZc();
  4156. break;
  4157. case 1800:
  4158. enemyZc3();
  4159. break;
  4160. case 1782:
  4161. enemyZc();
  4162. break;
  4163. case 1840:
  4164. case 1890:
  4165. case 1870:
  4166. case 1910:
  4167. crPt3(140, -60),
  4168. crPt3(180, -50),
  4169. crPt3(230, -60),
  4170. crPt3(280, -40),
  4171. crPt3(40, -70);
  4172. break;
  4173. case 1970:
  4174. crPt6(210, -100);
  4175. break;
  4176. case 2e3:
  4177. crPt6(280, -100);
  4178. break;
  4179. case 2020:
  4180. crPt6(140, -100);
  4181. break;
  4182. case 2150:
  4183. break;
  4184. case 2180:
  4185. break;
  4186. case 2220:
  4187. crzdj()
  4188. }
  4189. },
  4190. stage1 = function(a) {
  4191. switch (a) {
  4192. case 30:
  4193. enemyZc3(3);
  4194. break;
  4195. case 60:
  4196. enemyZc(3);
  4197. break;
  4198. case 110:
  4199. enemyZc3(4);
  4200. break;
  4201. case 150:
  4202. enemyZc(4);
  4203. break;
  4204. case 189:
  4205. crPt3(270, -190);
  4206. break;
  4207. case 190:
  4208. enemyZc();
  4209. break;
  4210. case 200:
  4211. crPt7(110, -50);
  4212. break;
  4213. case 248:
  4214. case 268:
  4215. case 288:
  4216. sBossZc2();
  4217. break;
  4218. case 300:
  4219. crPt7(110, -50);
  4220. break;
  4221. case 330:
  4222. enemyZc3();
  4223. break;
  4224. case 350:
  4225. enemyZc(3);
  4226. break;
  4227. case 406:
  4228. case 416:
  4229. case 426:
  4230. case 436:
  4231. sBossZc6();
  4232. break;
  4233. case 476:
  4234. case 486:
  4235. case 496:
  4236. case 506:
  4237. sBossZc6_2();
  4238. break;
  4239. case 536:
  4240. case 546:
  4241. case 556:
  4242. case 566:
  4243. case 576:
  4244. sBossZc6();
  4245. break;
  4246. case 560:
  4247. crPt4(190, -100);
  4248. break;
  4249. case 680:
  4250. crPt4(150, -60),
  4251. crPt3(200, -170);
  4252. break;
  4253. case 726:
  4254. case 736:
  4255. case 746:
  4256. case 756:
  4257. sBossZc6();
  4258. break;
  4259. case 790:
  4260. crPt4(270, -140),
  4261. crPt3(200, -60);
  4262. break;
  4263. case 511:
  4264. case 541:
  4265. case 571:
  4266. case 601:
  4267. sBossZc12();
  4268. break;
  4269. case 806:
  4270. case 816:
  4271. case 836:
  4272. case 846:
  4273. case 856:
  4274. case 866:
  4275. case 876:
  4276. sBossZc6_2();
  4277. break;
  4278. case 921:
  4279. case 951:
  4280. case 981:
  4281. case 1011:
  4282. sBossZc2();
  4283. break;
  4284. case 941:
  4285. case 971:
  4286. case 1001:
  4287. case 1031:
  4288. case 1061:
  4289. sBossZc12();
  4290. break;
  4291. case 1101:
  4292. enemyZc(5);
  4293. break;
  4294. case 1145:
  4295. enemyZc3(5);
  4296. break;
  4297. case 1142:
  4298. case 1212:
  4299. case 1224:
  4300. case 1236:
  4301. case 1248:
  4302. case 1260:
  4303. sBossZc5();
  4304. break;
  4305. case 1301:
  4306. enemyZc(6);
  4307. break;
  4308. case 1345:
  4309. enemyZc3(6);
  4310. break;
  4311. case 1380:
  4312. crPt7(110, -50);
  4313. break;
  4314. case 1400:
  4315. crPt7(130, -50);
  4316. break;
  4317. case 1430:
  4318. crPt7(150, -50);
  4319. break;
  4320. case 1416:
  4321. case 1426:
  4322. case 1436:
  4323. case 1446:
  4324. sBossZc6_3(120);
  4325. break;
  4326. case 1531:
  4327. enemyZc(5);
  4328. break;
  4329. case 1576:
  4330. case 1586:
  4331. case 1596:
  4332. case 1606:
  4333. sBossZc6_2();
  4334. break;
  4335. case 1616:
  4336. case 1626:
  4337. case 1636:
  4338. case 1646:
  4339. sBossZc6(),
  4340. sBossZc6_3(160);
  4341. break;
  4342. case 1731:
  4343. enemyZc(6);
  4344. break;
  4345. case 1705:
  4346. enemyZc3(6);
  4347. break;
  4348. case 1675:
  4349. enemyZc(6);
  4350. break;
  4351. case 1800:
  4352. enemyZc3(5);
  4353. break;
  4354. case 1782:
  4355. enemyZc(6);
  4356. break;
  4357. case 1900:
  4358. sBossZc4()
  4359. }
  4360. };
  4361. requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame;
  4362. var sj_8 = 0,
  4363. sj_11 = 0,
  4364. sj_15 = 0,
  4365. sj_1 = 0,
  4366. rad4 = 0,
  4367. arc5 = 0,
  4368. arc6 = 0;