-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
1 lines (1 loc) · 24.2 KB
/
index.html
1
<!DOCTYPE html><meta charset="utf-8"><style id=D9>*{margin:0;padding:0;user-select:none;outline:0;overflow:hidden;font-family:Arial;color:#000;text-align:center;}body{cursor:pointer;background-color:#000;}#D2,#D3,#D4,#D1,#D5{transform-origin:top left;position:fixed;}#D1,#D4,#D5{width:1920px;height:1080px;}#D5{background-color:#000d;padding:450px 0;z-index:-1;}#D8{background-color:#600d;padding:100px 0;}#D4{z-index:5;}#D7{position:absolute;}#D0,#D8{display:none;}#D6{position:fixed;right:20px;top:16px;background-color:#1af;width:40px;height:0;}h1,h2,h3,h4{display:inline-block;font-weight:900;}h4{padding:0 20px;border-radius:60px;margin:0 64px;}h4:hover{outline:16px solid red;}h4:active{scale:.9;}.B{filter:url(#Z1);-webkit-filter:url(#Z1);}</style><body oncontextmenu="return false" ondragstart="return false"><div id=D1></div><div id=D4><div id=D7><br><br><br><h2 class=B>OPTIONS</h2><br><br><br><h4 id=B1 class=B>AUDIO</h4><h2 id=L1 class=B>OFF</h2><br><br><br><h4 id=B2 class=B>MOVE UP</h4><h2 id=L2 class=B>KeyZ</h2><br><br><br><h4 id=B3 class=B>MOVE DOWN</h4><h2 id=L3 class=B>KeyZ</h2><br><br><br><br><br><br><h4 id=B4 class=B>OKAY</h4><br><br><br><br><br><br><h2 id=L4 class=B></h2><br><br><br><br><h4 id=B5 class=B>PLAY</h4><br><br><br><h4 id=B6 class=B>OPTIONS</h4><br><br><br><br><br><br><h3 class=B>WHEN YOUR NEIGHBORS ARE</h3><h1 class=B>MONGOLS</h1><br><br><br><br><h3 id=L5 class=B>0</h3><div id="D6" class=B></div><br><br><br><br><br><br><br><br><br><div id=D8><h1 class=B>GAME OVER</h1><br><br><br><br><h4 id=B7 class=B>OKAY</h4></div></div></div><div id="D5"><h2 class=B>PRESS NEW KEY</h2></div></body><script>(function(){let e=e=>console.log(e),o=1920,t=1080,a,l,r,i,n,f,s,c,g,y=0,d=1,p=window,h=document,m=h.body,u=p.localStorage,w=Math,x=w.min,$=w.max,v=w.abs,b=w.cos,F=w.sin,A=w.PI*2,_=w.imul,E,D,X,R,I,Y,T,S,L,k=0,B,z=4,P=5,N=6,C=7,O=8,U=9,G=10,M=11,H=12,Z=13,J=14,K=15,j=16,q=17,Q=18,V=19,W=20,ee=21,oe=0,te=1,ae=2,le=3,re=4,ie=5,ne=6,fe=7,se=8,ce=0,ge=1,ye=2,de=0,pe=ge,he,me,ue,we,xe,$e,ve,be,Fe,Ae,_e,Ee,De,Xe,Re=0,Ie,Ye,Te,Se,Le,ke,Be,ze,Pe,Ne,Ce,Oe=4e4,Ue=0,Ge=(e,o,t,a,l,r,i,n,f,s)=>{let c=Ce,g=Ue*6;Pe[g+4]=f||4294967167;Ne[g+5]=s||0;g*=2;c[g]=l;c[g+1]=r;c[g+2]=i;c[g+3]=n;c[g+4]=e;c[g+5]=o;c[g+6]=t;c[g+7]=a;Ue++},Me=(e,o,t,a,l,r)=>Ge(0,0,1,1,e,o,t,a,l,r),He=()=>{Ie.clear(Ie.COLOR_BUFFER_BIT);Ie.bufferSubData(Ie.ARRAY_BUFFER,0,Pe.subarray(0,Ue*6));Se.drawElementsInstancedANGLE(Ie.TRIANGLES,6,Ie.UNSIGNED_BYTE,0,Ue);Ue=0},Ze=(e,o,t,a)=>Ie.clearColor(e,o,t,a),Je=e=>{Ye=e;Ie=e.getContext("webgl",{antialias:0,preserveDrawingBuffer:1});Se=Ie.getExtension("ANGLE_instanced_arrays");Ze(0,0,0,0);let o=0,t=(e,t,a)=>{var l=Ie.getAttribLocation(c,e);Ie.enableVertexAttribArray(l);Ie.vertexAttribPointer(l,a,t,0,u,o);Se.vertexAttribDivisorANGLE(l,1);if(t==Ie.SHORT)a*=2;if(t==Ie.FLOAT)a*=4;o+=a},a=(e,o)=>{var t=Ie.createShader(e);Ie.shaderSource(t,o);Ie.compileShader(t);return t},l=(e,o,t=Ie.STATIC_DRAW)=>{Ie.bindBuffer(e,Ie.createBuffer());Ie.bufferData(e,o,t)},r="attribute",i="varying",n="uniform",f=a(Ie.VERTEX_SHADER,`${r} vec2 a;${r} vec2 b;${r} vec2 c;${r} vec4 d;${r} vec4 e;${r} float f;${i} highp vec2 g;${i} vec4 h;${n} vec2 i;${n} vec2 j;void main(void){vec2 k;if(f!=0.0){float l=cos(f);float m=sin(f);vec2 n=c*(a-0.5);k=(b+vec2(l*n.x-m*n.y,m*n.x+l*n.y)+c/2.0)/i;}else{k=(b+c*a)/i;}gl_Position=vec4(k.x-1.0,1.0-k.y,0.0,1.0);g=(d.xy+d.zw*a)/j;if(e.x>127.0){float o=pow(2.0,(e.x-127.0)/16.0)/255.0;h=vec4(e.w*o,e.z*o,e.y*o,1.0);}else h=vec4(e.w/255.0,e.z/255.0,e.y/255.0,e.x/127.0);}`),s=a(Ie.FRAGMENT_SHADER,`${i} highp vec2 g;${i} highp vec4 h;${n} sampler2D p;void main(void){gl_FragColor=texture2D(p,g)*h;}`),c=Ie.createProgram();Ie.attachShader(c,f);Ie.attachShader(c,s);Ie.linkProgram(c);Ie.useProgram(c);Te=c;Ie.blendFunc(Ie.SRC_ALPHA,Ie.ONE_MINUS_SRC_ALPHA);Ie.enable(Ie.BLEND);Ie.disable(Ie.DEPTH_TEST);l(Ie.ELEMENT_ARRAY_BUFFER,new Uint8Array([0,1,2,2,1,3]));l(Ie.ARRAY_BUFFER,new Float32Array([0,0,0,1,1,0,1,1]));var g=Ie.getAttribLocation(c,"a");Ie.enableVertexAttribArray(g);Ie.vertexAttribPointer(g,2,Ie.FLOAT,0,0,0);var y=2,d=2,p=4,h=4,m=1,u=y*2+d*2+p*2+h+m*4,w=new ArrayBuffer(Oe*u);Ce=new Int16Array(w);Ne=new Float32Array(w);Pe=new Uint32Array(w);l(Ie.ARRAY_BUFFER,w,Ie.DYNAMIC_DRAW);t("b",Ie.SHORT,y);t("c",Ie.SHORT,d);t("d",Ie.SHORT,p);t("e",Ie.UNSIGNED_BYTE,h);t("f",Ie.FLOAT,m)},Ke=e=>Ie.texParameteri(Ie.TEXTURE_2D,e,Ie.NEAREST),je=e=>{Ie.bindTexture(Ie.TEXTURE_2D,Ie.createTexture());Ie.texImage2D(Ie.TEXTURE_2D,0,Ie.RGBA,Ie.RGBA,Ie.UNSIGNED_BYTE,e);Ie.generateMipmap(Ie.TEXTURE_2D);Ie.activeTexture(Ie.TEXTURE0);Ke(Ie.TEXTURE_MAG_FILTER);Ke(Ie.TEXTURE_MIN_FILTER);Be=e.width;ze=e.height;Ie.uniform2f(Ie.getUniformLocation(Te,"j"),Be,ze);Ie.viewport(0,0,Ye.width,Ye.height);Ie.uniform2f(Ie.getUniformLocation(Te,"i"),Ye.width/2,Ye.height/2);Le=1},qe=.5,Qe=48e3,Ve=0,We=[],eo=(e,o,t,a,l,r,i,n,f,s,c,g,y,d,p,h,m,u,$)=>{let _=e=>e>0?1:-1,E=n*=500*A/Qe/Qe,D=o*=A/Qe,X=[],R=0,I=0,Y=0,T=1,S=0,L=0,k=0,B,z;t*=Qe+9;u*=Qe;a*=Qe;l*=Qe;h*=Qe;f*=500*A/Qe**3;d*=A/Qe;s*=A/Qe;c*=Qe;g=g*Qe|0;for(z=t+u+a+l+h|0;Y<z;X[Y++]=k){if(!(++L%(p*100|0))){k=r?r>1?r>2?r>3?F((R%A)**3):w.max(x(w.tan(R),1),-1):1-(2*R/A%2+2)%2:1-4*v(w.round(R/A)-R/A):F(R);k=(g?1-$+$*F(A*Y/g):1)*_(k)*v(k)**i*e*qe*(Y<t?Y/t:Y<t+u?1-(Y-t)/u*(1-m):Y<t+u+a?m:Y<z-h?(z-Y-h)/l*m:0);k=h?k/2+(h>Y?0:(Y<z-h?1:(z-Y)/h)*X[Y-h|0]/2):k}B=(o+=n+=f)*b(d*I++);R+=B-B*y*(1-(F(Y)+1)*1e9%2);if(T&&++T>c){o+=s;D+=s;T=0}if(g&&!(++S%g)){o=D;n=E;T=T||1}}We.push({samples:X,buffer:0})},oo=e=>{if(vo.audio){if(!Ve)to();let o=We[e];if(o.buffer)o.buffer.disconnect(Ve.destination);let t=Ve.createBuffer(1,o.samples.length,Qe),a=Ve.createBufferSource();t.getChannelData(0).set(o.samples);a.buffer=t;a.connect(Ve.destination);a.start(0);o.buffer=a}},to=()=>Ve=new(p.AudioContext||p.webkitAudioContext),ao=()=>{Ve.close();to()},lo=(e,o,t)=>e<o?o:e>t?t:e,ro=e=>h.getElementById(e),io=(e,o)=>e.splice(o,1),no=(e,o)=>e.style.display=o?"block":"none",fo=e=>D1.style.background=`linear-gradient(#1af 0%, #fff ${e}px, #6e5 ${e}px, #5c6 100%)`,so=(e=0)=>{r.clearRect(0,0,o,t);if(e)for(let e=256;e<t;e+=4)r.fillRect(Do(0,o),e,Do(8,48),2)},co=(e,o,t)=>yo(m,`<canvas id=${e} width=${o} height=${t}></canvas>`),go=(e,o)=>e.innerHTML=o,yo=(e,o)=>e.innerHTML+=o,po=(e,o,t)=>yo(D9,`h${e}{font-size:${o}px;line-height:${t}px;}`),ho=()=>D6.style.height=be+"px",mo=(e,o)=>{e.onclick=e=>{oo(z);o()}},uo=e=>D7.style.top=e+"px",wo=(e,o=.25,t=3)=>(R+e.randomness)%o>o/2?0:t,xo=e=>e.length,$o="wynam",vo,bo=()=>u.getItem($o),Fo=()=>u.setItem($o,JSON.stringify(vo)),Ao=()=>{vo={best:0,audio:1,controls:[{key:81,code:"KeyQ"},{key:65,code:"KeyA"}]};Fo()},_o={seed:0,setSeed:e=>_o.seed=e,getSeed:()=>_o.seed,random:()=>{_o.seed+=1831565813;let e=_o.seed;e=_(e^e>>>15,e|1);e^=e+_(e^e>>>7,e|61);return((e^e>>>14)>>>0)/4294967296}},Eo=()=>_o.random(),Do=(e,o)=>~~(Eo()*(o-e)+e),Xo=(e,o)=>{c=e;g=o;D5.style.zIndex=9;n=1},Ro=()=>go(L1,vo.audio?"ON":"OFF"),Io=e=>{Fe+=e;go(L5,Fe.toLocaleString());if(!Ae){if(Fe>vo.best){Ae=1;for(let e=0;e<7;e++){To(2,960-128+Do(0,256),40+Do(0,40),Eo()*A,ea+Do(0,2),300+Eo()*100,1,2,0,1+Eo(),Eo()<.5?-A*.05:A*.05,-10+Eo()*20,-10+Eo()*20)}}}},Yo=(e,o,t,a,l,r,i,n,f,s,c,g,y,d,p,h,m,u,w,x,$,v,b,F,A)=>({type:e,x:o,y:t,vx:a,vy:l,radius:r,leaping:i,leaving:n,collides:f,actionDelay:s,randomness:c,timed:g,damage:y,texture:d,ttl:p,rotation:h,iX:m,iY:u,scale:w,alpha:x,rotationRate:$,gx:v,gy:b,fades:F,shrinks:A,counter:p,originalAlpha:x,originalScale:w}),To=(e,o,t,a,l,r,i,n,f,s,c,g=0,y=0)=>{he.push(Yo(ne,o,t,b(a)*r,F(a)*r,0,0,0,0,0,0,0,0,Yt(l),e,a,0,0,s,n,c,g,y,i,f))},So=e=>{e.x+=e.vx*E;e.y+=e.vy*E},Lo=(e,o,t)=>{let a=A*Eo();for(let l=0;l<o;l++){ue.push(Yo(fe,e.x,e.y-60,b(a)*650,F(a)*650,0,0,0,0,0,0,1,0,Yt("shrapnel2"),t,0,0,0,1,1));a+=A/o}To(.4,e.x-66,e.y-120,Eo()*A,ea+Do(0,2),0,1,1,0,2+Eo(),0,0,0);for(let o=0;o<5;o++){To(.75,e.x-80+Do(0,80),e.y-160+Do(0,80),A*-.375+Eo()*(A*.25),ta+Do(0,2),20+Do(0,20),1,Eo()*.25,0,2+Eo()*.5,A*.005*Eo(),0,0)}},ko=(e,o)=>{for(let t=0;t<o;t++){To(1,e.x-30,e.y-40,A*-.375+Eo()*(A*.25),aa+Do(0,9),500+Do(50,250),1,1,1,.5+Eo()*.5,0,0,15+Do(10,20))}},Bo=e=>{oo(N);ko(zo,7+Do(0,5));if((be-=e)<=0){be=0;oo(Q);no(D8,1);pe=ye;i=0;if(Ae){vo.best=Fe;go(L4,vo.best.toLocaleString());Fo()}}},zo=Yo(ie,o-200,0,0,0),Po,No,Co,Oo,Uo,Go,Mo,Ho,Zo=0,Jo=1,Ko=2,jo=3,qo=4,Qo=5,Vo=6,Wo=7,et=[{c1:`d00`,c2:"800",t:"H",p:()=>{oo(W);be=lo(be+100,0,1048)}},{c1:`9b0`,c2:"560",t:"B",p:()=>{oo(K);for(let e=0;e<7;e++){let e=-t+Do(0,999);ue.push(Yo(fe,50+Do(0,1500),e,0,700+Do(0,300),0,1,e+t*1.25,0,0,0,0,0,Yt(Jt),0,0,0,0,1,1))}}},{c1:`59f`,c2:"04a",t:"Y",p:e=>{oo(V);Io(5e3);To(1,e.x-30,e.y-40,0,"points",0,1,1,0,1,0,0,-150)}},{c1:`e50`,c2:"940",t:"R",p:()=>{oo(J);_e=lo(_e-.1,.1,9)}},{c1:`3ca`,c2:"276",t:"P",p:()=>{oo(q);Ee=lo(Ee-50,-1200,-400)}},{c1:`c4e`,c2:"80b",t:"G",p:()=>{oo(j);Xe=1;for(let e=0;e<4;e++){To(1,-275+Do(0,24),zo.y-75+Do(0,30),0,"rail"+Do(0,3),0,1,.6,0,2,0,0,0)}}},{c1:`aaa`,c2:"777",t:"S",p:()=>{oo(J);De=lo(De+25,0,350)}},{c1:`f59`,c2:"d05",t:"Z",p:()=>{T=1;L=6;S=.2}}],ot=()=>{spawnPowerup=e=>{let a=Do(100,o-400),l=Do(300,t-200);xe.push(Yo(se,a,l,0,0,50,e.p,0,1,0,Eo(),oa+e.t,0,Yt(oa+e.t),4+Eo(),0,0));To(.1,a-1,l-1,0,"powerup_flash",0,1,1,0,1,0,0,0)};if((Mo-=E)<0){Mo+=2+Eo();spawnPowerup(et[Vo])}if((Go-=E)<0){Go+=4+Eo();spawnPowerup(et[Ko])}if((Uo-=E)<0){Uo+=5+Eo();spawnPowerup(et[Qo])}if((Oo-=E)<0){Oo+=7+Eo();spawnPowerup(et[Jo])}if((Ho-=E)<0){Ho+=12+Eo();spawnPowerup(et[Wo])}if((Co-=E)<0){Co+=9+Eo();spawnPowerup(et[Zo])}if((Po-=E)<0){Po+=1+Eo()*Y;spawnPowerup(et[jo])}if((No-=E)<0){No+=1+Eo()*Y;spawnPowerup(et[qo])}},tt=[],at,lt,rt,it,nt=0,ft="feFlood",st="filter",ct="feGaussianBlur",gt="feColorMatrix",yt="feTurbulence",dt="feDisplacementMap",pt="feComposite",ht=' operator="',mt="feSpecularLighting",ut="fePointLight",wt='" result="',xt="stdDeviation",$t="0 0 0 0 0, ",vt="0000",bt=e=>e.match(/[G-Z]/g)?`filter="url(#${e})"`:`fill="#${e}"`,Ft=(e,o)=>`<svg width="${e}" height="${o}" version="1.1" viewBox="0 0 ${e} ${o}" xmlns="http://www.w3.org/2000/svg">`,At=(e,o,t,a,l,r=0,i=r,n=0,f="")=>`<rect x="${e}" y="${o}" width="${t}" height="${a}" ${bt(l)} rx="${r}" ry="${i}" stroke-width="${n}" stroke="#${f}"/>`,_t=(e,o,t,a,l,r,i)=>`<rect transform="rotate(${i})" x="${e}" y="${o}" width="${t}" height="${a}" fill="#${l}" rx="${r}"/>`,Et=(e,o,t=0,a=vt)=>`<path d="${e}" fill="#${o}" stroke-width="${t}" stroke="#${a}"/>`,Dt=(e,o,t)=>`<use href="#${e}" x="${o}" y="${t}"/>`,Xt=(e,o,t,a,l)=>`<text x="${e}" y="${o}" fill="#${a}" font-family="Arial" font-size="${l}px" font-weight="900">${t}</text>`,Rt=(e,o)=>`${At(e,o,11,18,na)} ${At(e+10,o,14,18,ia)}`,It=(e,o,t,l=1)=>{let r=new Image;r.onload=()=>{let i=r.width,n=r.height;a.getContext("2d").drawImage(r,o,t,i*l,n*l);tt[e]={x:o,y:t,w:i*l,h:n*l};if(at){je(a);lt=[{body:Yt(zt),bodyX:-44,bodyY:-100,weapon:Yt(Ct),weaponX:-50,weaponX2:0,weaponY:-100,foot:Yt(Pt),leftFootX:-45,leftFootY:0,rightFootX:1,rightFootY:3},{body:Yt(zt),bodyX:-44,bodyY:-100,weapon:Yt(Mt),weaponX:-50,weaponX2:5,weaponY:-50,foot:Yt(Pt),leftFootX:-45,leftFootY:0,rightFootX:1,rightFootY:3},{body:Yt(zt),bodyX:-44,bodyY:-100,weapon:Yt(Ot),weaponX:-110,weaponX2:0,weaponY:-75,foot:Yt(Pt),leftFootX:-45,leftFootY:0,rightFootX:1,rightFootY:3},{body:Yt(zt),bodyX:-44,weaponX2:0,bodyY:-100,weapon:Yt(Ut),weaponX:-65,weaponY:-70,foot:Yt(Pt),leftFootX:-45,leftFootY:0,rightFootX:1,rightFootY:3},{body:Yt(zt),bodyX:-44,weaponX2:0,bodyY:-100,weapon:Yt(Gt),weaponX:-45,weaponY:-30,foot:Yt(Pt),leftFootX:-45,leftFootY:0,rightFootX:1,rightFootY:3},{body:Yt(kt),bodyX:-60,bodyY:-120,weapon:Yt(Nt),weaponX:-92,weaponY:-64,foot:Yt(Bt),leftFootX:-40,leftFootY:-10,rightFootX:10,rightFootY:-7}]}};r.src=`data:image/svg+xml;base64,${btoa(rt+"</svg>")}`},Yt=e=>tt[e],Tt=[-24,13,48,7,21,48,33,43,48,69,64,48,105,70,90,192,75,64,243,88,56,295,94,48,328,83,56,368,51,56,411,19,64,464,1,48],St=[-20,37,10,51,46,56,77,52,109,43,139,34,159,31,182,24,214,31,237,41,267,54,303,58,337,53,371,49,406,37,440,27,472,16],Lt=[87,-20,251,-2,342,-11,412,-35],kt="s_body",Bt="s_foot",zt="m_body",Pt="m_foot",Nt="bfg",Ct="w_sword",Ot="w_spear",Ut="w_bomb",Gt="w_unnarmed",Mt="w_ram",Ht="p_bfg",Zt="p_spear",Jt="p_bomb",Kt="p_sword",jt="d_mountain",qt="d_temple",Qt="d_cloud",Vt="d_bush_b",Wt="d_bush_f",ea="muzzle",oa="powerup",ta="smoke",aa="blood",la="658",ra="546",ia="fb8",na="d76",fa="633",sa="a86",ca="975",ga="743",ya="da7",da="777",pa="bbb",ha="c98",ma="ecb",ua="aaa",wa="eee",xa="654",$a="a76",va="860",ba="b93",Fa="540",Aa="19d",_a="28c",Ea="955",Da="d56",Xa="356",Ra="fff",Ia="4a4",Ya="5c4",Ta="0006",Sa="f00",La=(e,o=0,t=Sa)=>`<${st} id="Z${++nt}" x="-25%" y="-25%" width="150%" height="160%"><feFlood flood-color="#${t}${wt}J"></feFlood><${yt} baseFrequency="0.1" type="fractalNoise" numOctaves="1" seed="${o}${wt}K"></${yt}><${ct} in="SourceAlpha" ${xt}="0.1${wt}L"></${ct}><${dt} in="L" in2="K" scale="25${wt}M"></${dt}><${pt} in="J" in2="M"${ht}in${wt}N"></${pt}><${gt} type="matrix" values="${$t}${$t}${$t}0 0 0 1 0" in="N${wt}O"></${gt}><${ct} ${xt}="2" in="O${wt}P"></${ct}><${mt} surfaceScale="5" specularConstant=".75" specularExponent="30" lighting-color="#fff" in="P${wt}Q">${e?"":`<${ut} x="-50" y="-100" z="400"></${ut}>`}</${mt}><${pt} ${ht}in" in="Q" in2="O"></${pt}><${pt} ${ht}arithmetic" k1="0" k2="1" k3="1" k4="0" in="N"></${pt}></${st}>`,ka=(e,o)=>{rt=Ft(512,e)+'<g id="a" fill="#4a2">'+At(47,37,14,48,o,24)+_t(17,53,14,48,o,24,-18)+_t(71,20,14,48,o,24,18)+"</g> ";for(let e=0;e<St.length;e+=2)rt+=At(St[e],St[e+1],40,200,o,20);for(let e=0;e<Lt.length;e+=2)rt+=Dt("a",Lt[e],Lt[e+1])},Ba=At(1,61,15,6,va)+At(16,61,15,6,ba)+Et("m16 61v-60l10 15-5 45z",ua)+Et("m16 61v-60l-10 15 5 45z",wa),za=(e,o,t,a=4294967167,l=0)=>Ge(e.x,e.y,e.w,e.h,o,t,e.w,e.h,a,l);p.onload=e=>{_o.setSeed(578945323);vo=bo();!vo?Ao():vo=JSON.parse(vo);go(L2,vo.controls[y].code);go(L3,vo.controls[d].code);go(L4,vo.best.toLocaleString());go(L1,vo.audio?"ON":"OFF");uo(-t);po(1,240,240);po(2,150,150);po(3,80,80);po(4,150,150);yo(D4,Ft(0,0)+La(0,Do(0,1e9))+"</svg>");co("D2",o,t);co("D3",o,t);co("D0",1024,2048);l=ro("D2");a=ro("D0");r=l.getContext("2d");r.globalAlpha=.6;r.fillStyle="#0002";fo(918);for(let e=0;e<4;e++)eo(.04,[261.6,293.6,329.6,391.9][e],0,.07,.49,0,.62,0,0,0,0,.05,.1,0,0,0,.33,.11,.04);eo(.1,633,.02,.01,.01,0,.99,79,0,633,.02,.06,0,63,.1,.05,.58,.02,.99);eo(.06,499,.02,.02,.06,1,1.65,-23,3.2,0,0,0,1.7,0,.1,0,.77,.02,0);eo(.02,444,.02,.03,.1,3,1.92,-8.9,-.6,0,0,.05,.8,0,.5,0,.54,.08,.02);eo(.07,382,.03,.27,.48,4,.07,.2,.2,0,0,0,1.9,-66,1,0,.46,.15,0);eo(.02,1e4,0,0,.1,0,1,0,0,0,0,.01,6.8,-.02,0,0,1,0,0);eo(.03,360,0,0,.12,2,2,0,0,0,0,0,9,0,.1,0,1,0,0);eo(.05,337,0,.07,.2,0,1.65,0,1.7,50,0,.05,1.5,74,.3,.02,.91,.07,.03);eo(.05,494,.03,.05,.05,2,1.67,2.8,0,0,0,0,.5,0,.5,.12,.91,.06,0);eo(.05,364,0,.08,.17,3,1.08,2.9,0,0,0,0,.6,13,.4,.15,.86,.05,.26);eo(.06,388,.01,.12,.5,3,4.1,0,0,0,0,.01,.7,-29,.4,.01,.31,.08,.47);eo(.05,189,.01,.09,.13,2,.07,1.1,-1.5,870,.03,.11,0,0,0,.05,.67,.03,0);eo(.3,294,.09,.29,.29,3,0,-2.4,-.1,-17,.05,.01,0,0,0,.18,.94,.18,.09);eo(.4,717,.08,.24,.14,3,1.77,30,0,-66,.07,0,0,-73,0,0,.72,.03,.22);eo(.1,1986,.01,.1,.16,2,.75,0,0,0,0,0,0,0,0,.03,.61,.04,0);eo(1,891,.03,.15,.32,2,2.51,.8,.9,0,0,0,1.2,1.3,.1,.33,.46,.08,.08);eo(.3,72,.01,.19,.2,1,.16,-3.9,0,358,.01,.03,0,0,0,.09,.67,.14,0);eo(.3,189,.01,.09,.13,2,.07,1.1,-1.5,870,.03,.11,0,0,0,.05,.67,.03,0);eo(.06,384,.02,.27,.53,4,3.02,0,.1,50,.01,-.02,0,0,.1,.05,.47,.18,0);rt=Ft(117,130)+At(29,51,44,20,ha)+At(73,51,17,20,ma)+At(29,71,42,31,ua)+At(71,71,14,31,wa)+At(0,116,114,16,Ta,55)+Et("m1 51h77l-20-50z",xa)+Et("m78 51h38l-58-50z",$a);It(kt,94,0);rt=Ft(39,11)+At(25,1,13,9,wa)+At(1,1,25,9,ua);It(Bt,94,140);rt=Ft(93,123)+At(8,1,69,59,ra,35,30)+At(8,1,69,59,ra,35,30)+At(16,1,61,56,la,30,28)+At(15,67,56,32,ra)+At(29,91,42,8,la)+At(29,67,42,21,la)+At(10,35,61,32,na)+At(27,52,44,15,ia)+At(3,30,36,18,ca,6)+At(26,30,55,18,sa,5)+At(0,106,88,16,Ta,43)+Et("m70 64-2-7-11-2-19 2-2 7",vt,3,fa)+Et("m42 62h21l-8 19z",fa);It(zt,0,0);rt=Ft(39,11)+At(1,1,13,9,ca)+At(13,1,25,9,sa);It(Pt,0,140);rt=Ft(140,50)+At(105,1,32,42,ba,16,21)+At(63,3,72,38,va,15,19)+At(53,1,32,42,ba,16,21)+At(11,3,72,38,va,15,19)+At(1,2,30,40,va,15,20,2,ba)+At(128,24,11,22,ma)+At(114,24,14,22,ha)+At(63,36,11,13,ma)+At(49,36,14,13,ha);It(Nt,220,0);rt=Ft(89,28)+Rt(3,1)+Rt(69,7);It(Gt,220,430);rt=Ft(163,32)+At(1,12,123,8,ga)+Et("m117 16h45l-40-15z",wa)+Et("m117 16h45l-40 15z",ua);It(Zt,220,390);rt+=Rt(70,7);It(Ot,220,52);rt=Ft(138,55)+At(1,8,134,38,ga,15,19)+At(107,8,30,38,ya,15,19)+Rt(65,36)+Rt(19,1)+Et("m120 28c-1-6 10-3 3 4-6 5-15-8-5-14 11-5 18 13 7 21",vt,2,ga);It(Mt,220,88);rt=Ft(86,73)+At(1,9,77,63,da,37)+At(15,11,63,58,pa,31)+At(34,1,7,10,da)+At(41,1,9,11,pa);It(Jt,320,144);rt+=Rt(58,49)+Rt(1,49);It(Ut,220,144);rt=Ft(32,86)+Ba+At(11,67,5,18,ga)+At(16,67,5,18,ya);It(Kt,220,465);rt=Ft(89,86)+Rt(3,67)+Rt(69,67)+At(1,61,15,6,va)+At(16,61,15,6,ba)+Et("m16 61v-60l10 15-5 45z",ua)+Et("m16 61v-60l-10 15 5 45z",wa);It(Ct,220,300);rt=Ft(23,26)+At(1,1,21,24,da,12)+At(6,2,16,21,wa,10);It(Ht,220,242);for(let e=0;e<3;e++){rt=Ft(36,36)+Et("m1 1 34 7-22 27z",[Sa,"f80","ff0"][e]);It("shrapnel"+e,130,440+e*40)}for(let e=0;e<et.length;e++){let o=et[e];rt=Ft(107,72)+At(12,59,83,12,Ta)+At(12,1,24,64,o.c2)+At(31,1,64,64,o.c1)+Xt(36,55,o.t,wa,64);It(oa+o.t,400,e*75)}rt=Ft(120,48)+Xt(1,32,5e3,wa,32);It("points",400,600);rt=Ft(85,66)+At(1,1,83,64,wa);It("powerup_flash",512,405);for(let e=0;e<10;e++){rt=Ft(60,60)+La(1,Do(1,1e9))+At(5,5,50,50,"Z"+nt,20);It(aa+e,0,155+e*64)}for(let e=0;e<10;e++){rt=Ft(60,60)+La(0,Do(1,1e9),"ccc")+At(5,5,50,50,"Z"+nt,20);It(ta+e,65,155+e*64)}for(let e=0;e<4;e++){rt=Ft(66,66)+Et("m50 65-21-19-28 4 19-20-5-29 22 18 28-3-19 21z",[Sa,"f80","ff0","9df"][e]);It(ea+e,130,155+e*70)}for(let e=0;e<4;e++){rt=Ft(960,32)+La(1,Do(1,1e9),"08f")+At(5,5,950,22,"Z"+nt,8);It("rail"+e,0,800+e*40)}rt=Ft(226,200)+At(31,35,11,164,Ea)+At(41,35,14,164,Da)+At(161,35,11,164,Ea)+At(171,35,14,164,Da)+At(94,35,11,25,Ea)+At(104,35,14,25,Da)+At(4,55,14,15,Ea)+At(15,55,210,15,Da)+At(1,15,14,20,Ea)+At(13,15,210,20,Da)+At(1,1,222,15,Xa);It(qt,160,580);rt=Ft(401,228)+Et("m1 227 205-226 194 226z",Aa)+Et("m1 227h150l55-226z",_a);It(jt,623,393);rt=Ft(512,181);for(let e=0;e<Tt.length;e+=3)rt+=At(Tt[e],Tt[e+1],Tt[e+2],200,Ra,Tt[e+2]/2);It(Qt,512,0);ka(135,Ia);It(Vt,512,183);ka(70,Ya);at=1;It(Wt,512,320);mo(B5,(e=>{B=.25;R=0;Po=.5;No=1;Co=20;Oo=15;Ho=18;Uo=12;Go=7;Mo=6;I=0;Y=1;$e=0;ve=3;f=0;s=0;Re=2;_e=1.5;Ee=-400;ue=[];we=[];xe=[];he=[];Ae=0;Fe=0;go(L5,0);be=1048;ho();De=100;zo.y=t/2;uo(-t*2);fo(256);so(1);pe=de;i=1}));mo(B6,(e=>uo(0)));mo(B7,(e=>{pe=ge;i=0;no(D8,0);so();fo(918);uo(-t)}));mo(B1,(e=>{vo.audio=!vo.audio;Ro();Fo()}));mo(B2,(e=>Xo(y,L2)));mo(B3,(e=>Xo(d,L3)));mo(B4,(e=>uo(-t)));Je(D3);D4.onclick=e=>{if(pe===de){let o=e.offsetX,t=e.offsetY;if(xo(xe)){for(let a=xe.length-1;a>=0;a--){actor=xe[a];if(actor.type===se){if(o>actor.x-58&&o<actor.x+58&&t>actor.y-40&&t<actor.y+40){io(xe,a);actor.leaping(actor);for(let o=0;o<7;o++){To(.2,e.offsetX-33,e.offsetY-33,Eo()*A,ea+Do(0,2),750+Eo()*100,1,1,0,.5+Eo(),Eo()<.5?-A*.05:A*.05,0,0)}return}}}}}};p.onkeydown=e=>{let o=e.keyCode;if(i){if(!f&&(o==38||o==vo.controls[y].key))f=1;if(!s&&(o==40||o==vo.controls[d].key))s=1}};p.onkeyup=e=>{let o=e.keyCode;if(n){go(g,e.code);vo.controls[c].code=e.code;vo.controls[c].key=o;n=0;D5.style.zIndex=-1;Fo()}else if(i){if(f&&(o==38||o==vo.controls[y].key))f=0;if(s&&(o==40||o==vo.controls[d].key))s=0}};p.onresize=e=>{let a=p.innerWidth;scaleAndCenter=e=>{e.style.transform=`scale(${x(a/o,p.innerHeight/t)})`;e.style.left=~~(a-D1.getBoundingClientRect().width)/2+"px"};scaleAndCenter(D1);scaleAndCenter(l);scaleAndCenter(D3);scaleAndCenter(D4);scaleAndCenter(D5)};p.onresize();he=[];X=Date.now();onEnterFrame()};let Pa=()=>{if(xo(he)){for(let e=he.length-1;e>=0;e--){actor=he[e];if((actor.counter-=E)<=0){io(he,e)}else{actor.vx+=actor.gx;actor.vy+=actor.gy;So(actor);actor.rotation+=actor.rotationRate;let e=1/actor.ttl*actor.counter;if(actor.fades)actor.alpha=actor.originalAlpha*e;if(actor.shrinks){actor.scale=actor.originalScale*e;actor.iX=actor.texture.w*actor.originalScale*(1-e)/2;actor.iY=actor.texture.h*actor.originalScale*(1-e)/2}me.push(actor)}}}},Na=e=>{$e=ve+Eo()*.1;let o=Eo(),a=oe;if(o<.6)a++;if(o<.4)a++;if(o<.1)a++;k=a;xe.push(Yo(a,-150+Do(0,70),Do(350,t-100),[100*Y,80*Y,60*Y,300*Y][a]+Do(10,30),0,30,0,0,1,2+Eo()*2,o))};let Ca=()=>{if(xo(xe)){let e,a=xe.length;for(let l=a-1;l>=0;l--){e=xe[l];if(e.type!=se){So(e);if(e.leaping||e.leaving){e.vy+=45;if(e.x>o+200){io(xe,l);Bo([10,25,50,100,25][e.type])}else if(e.y>t+150){io(xe,l)}else{me.push(e)}}else{if(e.type===ae){if((e.actionDelay-=E)<0){let o=w.atan2(zo.y+20-e.y,zo.x-e.x),t=800*Y+Eo()*100;we.push(Yo(fe,e.x-110,e.y-75,b(o)*t,F(o)*t,160,0,0,0,0,0,0,40,Yt(Zt),0,0,0,0,1,1));e.type=re}}else if(e.type===oe){if((e.actionDelay-=E)<0){we.push(Yo(fe,e.x-60,e.y-92,600*Y+Eo()*100,0,16,43,0,0,0,0,0,20,Yt(Kt),0,0,0,0,1,1,A*.07+Eo()*.02));e.type=re}}if(e.x>o-275){e.leaping=1;e.collides=0;e.vx=700;e.vy=-850;oo(P)}}}else{if((e.ttl-=E)<0){io(xe,l);To(.3,e.x-53,e.y-36,0,e.timed,0,1,1,0,1,0,0,-200)}else{if((e.randomness-=E)<0){e.randomness++;To(.15,e.x-42,e.y-36,0,"powerup_flash",0,1,1,0,1,0,0,0)}}}me.push(e)}a=xe.length;for(let o=0;o<a-1;o++){e=xe[o];for(let l=o+1;l<a;l++){let o=xe[l];if(e.collides&&o.collides){let a=o.x-e.x,l=o.y-e.y,r=w.sqrt(a*a+l*l);if(e.radius+o.radius>=r){let i=a/r,n=l/r,f=r*(e.radius/(e.radius+o.radius)),s=e.x+i*f,c=e.y+n*f;e.x=s-i*e.radius;e.y=lo(c-n*e.radius,300,t-50);o.x=s+i*o.radius;o.y=c+n*o.radius}}}}}};onEnterFrame=e=>{requestAnimationFrame(onEnterFrame);D=Date.now();E=(D-X)/1e3;X=D;if(pe===de){let e,l,i,n,c,g=(e,o)=>e.x>o.x-30&&e.x<o.x+30&&e.y>o.y-80&&e.y<o.y;I+=E;Y=lo(Y+3e-4,0,2);if((R+=E)>=1){R-=1;oo(U)}if((B-=E)<=0){oo(k);oo(O);B+=.25}za(Yt(jt),135,28);za(Yt(jt),890,28);ce=ce+30*E;for(let e=-(ce%512);e<o;e+=512)za(Yt(Qt),e,75,0,0,4294967056);for(let e=0;e<o;e+=512)za(Yt(Vt),e,124);za(Yt(qt),1600,60);for(let e=-197;e<o;e+=512)za(Yt(Wt),e,189);ot();me=[zo];zo.vy=0;if(f)zo.vy=-De;if(s)zo.vy=De;zo.y=lo(zo.y+zo.vy*E,300,t-25);if((Re-=E)<=0){Re=_e;i=zo.x-80;n=zo.y-50;ue.push(Yo(fe,i,n-6+Do(0,12),Ee,0,0,0,0,0,0,0,0,0,Yt(Ht),0,0,0,0,1,1));To(.5,i-30,n-30,A*.5,ta+Do(0,9),280+Do(0,70),1,.75,1,1,0,15-Eo(),-15+Eo());To(.05,i-30,n-20,Eo()*A,ea+Do(0,2),0,1,1,0,1,0,0,0)}if(xo(ue)){for(let o=ue.length-1;o>=0;o--){e=ue[o];So(e);if(e.leaping){if(e.y>=e.leaving){io(ue,o);Lo(e,3,.25)}else{me.push(e)}}else{e.timed?(e.ttl-=E)<0?io(ue,o):me.push(e):e.x<-64?io(ue,o):me.push(e)}}}if(xo(xe)&&xo(ue)){xe.sort(((e,o)=>e.x>o.x?1:-1));ue.sort(((e,o)=>o.x>e.x?1:-1));let e=e=>{oo([G,M,H,C,H][mongol.type]);mongol.leaving=1;mongol.collides=0;mongol.vy=-1e3-Do(200,500);mongol.vx=-500+Do(0,1e3);if(mongol.type===le)Lo(mongol,3,.25);ko(mongol,9);l=Yt(aa+Do(0,9));r.drawImage(a,l.x,l.y,l.w,l.h,mongol.x-20,mongol.y,l.w*1.5,l.h/Do(2,6));Io([100,250,500,1e3,50][mongol.type]);io(ue,e)};let o=o=>{for(let t=xe.length-1;t>=0;t--){mongol=xe[t];if(!mongol.leaping&&!mongol.leaving&&mongol.type!=se){if(g(c,mongol)){e(o);return}}}};if(Xe){for(let o=xe.length-1;o>=0;o--){mongol=xe[o];if(!mongol.leaping&&!mongol.leaving&&mongol.type!=se){if(mongol.y-32>zo.y-80&&mongol.y+16<zo.y)e(o)}}Xe=0}if(T){if((S-=E)<=0){S+=.2;let o=Do(0,xe.length-1);mongol=xe[o];if(mongol.type!=se&&!mongol.leaving&&!mongol.leaping){let t=mongol.x-480,a=mongol.y-535;for(let e=0;e<3;e++){oo(ee);To(.5,t+Do(0,20),a,A*.25,"rail"+Do(0,3),0,1,.75,0,1,0,0,0)}To(.5,mongol.x-45,mongol.y-80,Eo()*A,"muzzle3",0,1,2,0,1.5,0,0,0);e(o);if(L--<0)T=0}}}for(let e=ue.length-1;e>=0;e--){c=ue[e];o(e)}}ho(be);if(ve>.05)ve=lo(ve-=E/10,.05,10);if(($e-=E)<=0)Na();Ca();me.sort(((e,o)=>e.y>o.y?1:-1));if(xo(we)){for(let t=we.length-1;t>=0;t--){e=we[t];So(e);e.x>o?io(we,t):me.push(e);if(g({x:e.x+e.radius,y:e.y+e.leaping},zo)){Bo(e.damage);io(we,t)}}}Pa();let y=4294967167;for(let o=0;o<me.length;o++){e=me[o];i=e.x;n=e.y;if(e.type<ne){overlayImage=lt[e.type];za(overlayImage.body,i+overlayImage.bodyX,n+overlayImage.bodyY,y,e.leaving?w.PI*-.125:0);if(e!=zo){za(overlayImage.foot,i+overlayImage.leftFootX,n+overlayImage.leftFootY+wo(e),y,e.leaving?w.PI*.125:0);za(overlayImage.foot,i+overlayImage.rightFootX,n+overlayImage.rightFootY-wo(e),y,e.leaving?w.PI*-.25:0)}else{za(overlayImage.foot,i+overlayImage.leftFootX,n+overlayImage.leftFootY+(e.vy!=0?wo(e):0));za(overlayImage.foot,i+overlayImage.rightFootX,n+overlayImage.rightFootY-(e.vy!=0?wo(e):0))}za(overlayImage.weapon,i+overlayImage.weaponX+wo(e,1,overlayImage.weaponX2),n+overlayImage.weaponY+wo(e,.5,5))}else{let o=e.texture;if(e.type===se){Ge(o.x,o.y,o.w,o.h,e.x-53,e.y-36,o.w,o.h)}else{if(e.rotationRate!=0)e.rotation+=e.rotationRate;Ge(o.x,o.y,o.w,o.h,e.x+e.iX,e.y+e.iY,~~(o.w*e.scale),~~(o.h*e.scale),4294967040+127*e.alpha,e.rotation)}}}}He()}})();</script></html>