-
Notifications
You must be signed in to change notification settings - Fork 163
/
index.html
1 lines (1 loc) · 24.7 KB
/
index.html
1
<meta charset="utf-8"><canvas id=C0 width=1024 height=768></canvas><canvas id=C1 width=1024 height=768></canvas><style onload="g=C0.getContext`webgl`;c=C1.getContext`2d`;for(let l in c)c[l[2]+[l[6]]]=l;for(let l in g)g[l[2]+l[6]+[l[17]]]=g[l];let x,v={};document.onkeydown=x=>{0>[37,38,39,40].indexOf(x.which)||x.preventDefault(),x.repeat||(v[x.which]=1)},document.onkeyup=x=>v[x.which]=0;let e,t=(x,v,e)=>x+e*(2*(v=(v-x)%(2*Math.PI))%(2*Math.PI)-v),f=(x,v,e)=>x+e*(v-x),a=(x,v,e)=>x.map(((x,t)=>f(x,v[t],e))),r=(x,v,e)=>x.map(((x,t)=>x+e*v[t])),l=(x,v)=>x[0]*v[0]+x[1]*v[1],o=x=>{if(!x)return'';let v=33*Math.max(0,(0|x)-10)/10,e=''+(0|v)%100;return(v/100|0)+'.'+(2>e.length?'0':'')+e},m=(x,v,e,t)=>{let f=[v[1],-v[0]],a=-l(x,v)*e,o=l(x,f)*t;return r([a*v[0],a*v[1]],f,o)},n=(x,v,e)=>(e=(x=>0>x?0:x>1?1:x)((e-x)/(v-x)))*e*(3-2*e),y=(x=1,v=.05,t=220,f=0,a=0,r=.1,l=0,o=1,m=0,n=0,y=0,i=0,M=0,h=0,s=0,u=0,c=0,w=1,d=0,p=0)=>{let z,A,C=Math,b=44100,S=2*C.PI,F=m*=500*S/b/b,D=t*=(1-v+2*v*C.random(v=[]))*S/b,g=0,N=0,R=0,_=1,E=0,P=0,U=0;for(n*=500*S/b**3,s*=S/b,y*=S/b,i*=b,M=b*M|0,A=(f=b*f+9)+(d*=b)+(a*=b)+(r*=b)+(c*=b)|0;A>R;v[R++]=U)++P%(100*u|0)||(U=l?l>1?l>2?l>3?C.sin((g%S)**3):C.max(C.min(C.tan(g),1),-1):1-(2*g/S%2+2)%2:1-4*C.abs(C.round(g/S)-g/S):C.sin(g),U=(M?1-p+p*C.sin(S*R/M):1)*(U>0?1:-1)*C.abs(U)**o*x*.1*(f>R?R/f:f+d>R?1-(R-f)/d*(1-w):f+d+a>R?w:A-c>R?(A-R-c)/r*w:0),U=c?U/2+(c>R?0:(A-c>R?1:(A-R)/c)*v[R-c|0]/2):U),z=(t+=m+=n)*C.cos(s*N++),g+=z-z*h*(1-1e9*(C.sin(R)+1)%2),_&&++_>i&&(t+=y,D+=y,_=0),!M||++E%M||(t=D,m=F,_=_||1);return(x=e.createBuffer(1,A,b)).getChannelData(0).set(v),(t=e.createBufferSource()).buffer=x,t.connect(e.destination),t.start(),t};e=new(window.AudioContext||webkitAudioContext);let i,M,h,s,u,w,d=[[[0,!0,0,-172,0,[[0,100,0,0],[2,0,220,12,-110,-14],[1,26,0,-27,30,-27,50,-27,160,-27]]],[12,!0,0,-172,0,[[0,100,0,0],[2,0,220,12,-110,-14],[1,26,0,-27,30,-27,50,-27,160,-27]]],[17,!0,0,-172,.4,[[0,100,0,0],[2,0,220,12,-110,-14],[1,26,0,-27,30,-27,50,-27,160,-27]]],[100,!1],[101,!1]],[[0,!0,0,-50,0,[[2,1,110,130,-55,0],[2,1,64,50,-32,-40],[1,50,21,0,61,9,110,46,132,98],[1,50,-21,0,-64,9,-115,42,-132,104],[1,50,-12,119,-56,128,-89,162,-106,223],[1,50,12,119,56,128,89,162,106,223]]],[5,!0,0,-50,0,[[2,1,110,130,-55,0],[2,1,64,50,-32,-40],[1,50,21,0,74,-22,126,-6,162,26],[1,50,-21,0,-74,-19,-147,-29,-169,37],[1,50,-3,120,-75,121,-106,169,-123,254],[1,50,9,119,55,122,113,97,53,164]]],[9,!0,0,-50,0,[[2,1,110,130,-55,0],[2,1,64,50,-32,-40],[1,50,21,0,75,-13,136,-26,191,-65],[1,50,-21,0,-76,-9,-126,-24,-167,-50],[1,50,-3,120,-89,105,-155,138,-96,202],[1,50,7,122,50,129,122,145,184,174]]],[12,!0,0,-50,0,[[2,1,110,130,-55,0],[2,1,64,50,-32,-40],[1,50,21,0,75,-13,136,-26,191,-65],[1,50,-21,0,-76,-9,-126,-24,-167,-50],[1,50,-3,120,-89,105,-155,138,-96,202],[1,50,7,122,50,129,122,145,184,174]]],[17,!0,0,-50,0,[[2,1,110,130,-55,0],[2,1,64,50,-32,-40],[1,50,21,0,77,-4,139,-8,211,-12],[1,50,-21,0,-101,9,-71,118,-7,214],[1,50,-3,120,-84,79,-81,115,-39,185],[1,50,7,122,60,136,132,192,166,292]]],[100,!1],[101,!1]],[[0,!0,0,200,0,[[1,50,-153,-34,-109,13,149,16,189,-34],[0,28,-92,62],[0,28,125,62]]],[5,!0,4,155,-.68,[[1,50,-153,-34,-109,13,149,16,189,-34],[0,28,-92,62],[0,28,125,62]]],[6,!1],[7,!0,66,200,2.95,[[1,50,-153,-34,-109,13,149,16,189,-34],[0,28,-92,62],[0,28,125,62]]],[8,!1],[9,!0,30,190,-.03,[[1,50,-153,-34,-109,13,149,16,189,-34],[0,28,-92,62],[0,28,125,62]]],[10,!1],[11,!0,78,220,3.13,[[1,50,-153,-34,-109,13,149,16,189,-34],[0,28,-92,62],[0,28,125,62]]],[12,!1],[13,!1],[14,!0,49,242,3.37,[[1,50,-153,-34,-109,13,149,16,189,-34],[0,28,-92,62],[0,28,125,62]]],[15,!1],[16,!0,13,185,.49,[[1,50,-153,-34,-109,13,149,16,189,-34],[0,28,-92,62],[0,28,125,62]]],[17,!0,8,178,.62,[[1,50,-153,-34,-109,13,149,16,189,-34],[0,28,-92,62],[0,28,125,62]]],[100,!1],[101,!1]],[[0,!1],[6,!0,40,171,-.32,[[1,90,-150,0,-50,0,50,0,150,0]]],[7,!1],[8,!0,54,184,-.2,[[1,90,-150,0,-50,0,50,0,150,0]]],[9,!1],[10,!0,50,200,.05,[[1,90,-150,0,-50,0,50,0,150,0]]],[11,!1],[12,!0,54,184,-.2,[[1,90,-150,0,-50,0,50,0,150,0]]],[13,!0,43,209,.18,[[1,90,-150,0,-50,0,50,0,150,0]]],[14,!1],[15,!0,43,209,.18,[[1,90,-150,0,-50,0,50,0,150,0]]],[16,!1],[101,!1]]],p=[([x,v,e,t])=>{c[c.ly]='#f00',c[c.ga](),c.arc(e,t,v,0,2*Math.PI),c.fill()},([x,v,e,t,f,a,r,l,o,m])=>{c[c.nd]=v,c[c.ga](),c.moveTo(e,t),c[c.zC](f,a,r,l,o,m),c[c.r]()},([x,v,e,t,f,a])=>{c[c.ly]=v?'#f00':'#000',c[c.lc](f,a,e,t)}],z=(x,v,e)=>!!x===x?x:Array.isArray(x)?x.map(((x,t)=>z(x,v[t],e))):x+e*(v-x),A=0,C=c[c.eL](-1,0,1,0);C.addColorStop(0,'#000'),C.addColorStop(1,'#0f0');let b=c[c.eL](0,-1,0,1);b.addColorStop(0,'#000'),b.addColorStop(1,'#00f');let S,F,D,N,R,_,E,P,U,k,L,q,X,B,G,I,O,T,J=['','Use the arrows','Use the ramp','Use momentum','Press down to become heavy','Press R to restart','','','Use the black hole','','','','','','','Use the rubber block'],Y=(x,v,e)=>(0>e&&(e+=1),e>1&&(e-=1),1/6>e?x+6*(v-x)*e:.5>e?v:2/3>e?x+(v-x)*(2/3-e)*6:x),Z=new Float32Array(8),H=v=>{x=[[[0,57.01,19.73],[0,61.3,19.65],[0,52.41,19.82],[0,47.84,19.91],[2,155,32,2,50],[3,158.84,236.64]],[[0,56.05,-1.21],[0,51.69,-2.01],[0,47.16,-1.21],[1,85.47,-2.48]],[[0,23.35,-8.65],[0,27.11,-8.65],[0,19.59,-8.55],[0,-43.24,5.77],[0,-40.16,5.74],[0,-36.98,5.69],[1,-7.36,-5.04]],[[0,-67.24,-6.84],[0,-64.65,-1.51],[0,-61.03,2.44],[0,-55.83,4.74],[0,65.54,-34.85],[0,65.53,-38.7],[0,65.66,-30.87],[0,11.19,-14.16],[0,14.66,-14.16],[1,35.77,-18.18]],[[0,65.68,10.95],[0,53.58,12.4],[0,78.17,11.9],[1,135.3,-6.75]],[[0,82.52,1.93],[0,82.27,5.38],[0,81.7,9],[0,6.02,1.6],[0,6.18,5.08],[0,6.91,8.67],[1,44.26,-42.05],[3,44,44.75]],[[0,-168.4,46.48],[0,-141.5,47.23],[0,-116.84,31.54],[0,-92.48,36.47],[0,-66.48,24.51],[0,-47.05,16.15],[0,-24.03,15.85],[1,-193.19,31.66],[3,-144.55,58.75]],[[0,-51.73,5.74],[0,48.98,1.6],[0,-52.66,9.62],[0,49.83,5.57],[0,.22,69.85],[0,-3.31,69.34],[0,-6.69,68.84],[0,3.85,69.6],[0,7.56,69.09],[1,-.19,-4.71],[3,-.44,80.42]],[[0,43.62,-23.02],[0,44.05,-26.7],[0,45.12,-30.06],[1,86.83,-26.93],[2,35.44,-10.49,2,10]],[[0,132.85,-39.31],[0,132.83,-42.44],[0,117.74,-39.57],[0,89.15,-18.62],[0,132.79,-45.31],[1,89.58,-43.89],[2,44.62,-10.17,2,10],[2,126.32,-26.08,2,10]],[[0,142.12,24.9],[0,147.19,20.7],[0,149.53,14.4],[0,38.5,21.07],[0,38.43,28.59],[0,42.37,34.96],[1,153.4,-22.7],[2,57.87,3.23,2,10],[2,133.47,-8.26,2,10],[3,54.02,46.96]],[[0,-87.54,32.55],[0,-93.45,32.62],[0,27.83,-20.08],[0,27.82,-23.93],[0,27.95,-16.1],[0,-46.41,8.25],[0,-42.57,2.02],[0,-36.11,-1.76],[0,-99.66,32.68],[0,-13.11,-.17],[0,-18.78,-.17],[0,-7.91,-.17],[1,33.4,-18.28],[2,-126.24,23.49,2,10],[3,-49.52,41.37]],[[0,-13.12,-23.52],[0,-17.05,-13.86],[0,-12.89,-4.09],[0,48.63,-3.75],[0,52.9,-14.08],[0,48.29,-24.53],[0,9.55,-43.17],[0,25.91,-43.82],[0,17.5,19.05],[0,25.77,16.27],[0,9.04,16.63],[1,17.87,-44.21],[2,17.55,-14.04,2,18],[3,17.39,44.97]],[[0,97.48,-12.9],[0,100.95,-18.71],[0,106.36,-22.59],[0,64.1,3.22],[0,66.35,9.35],[0,71.66,13.63],[0,61.69,-9.5],[0,171.64,-22.69],[0,177.05,-19.11],[0,180.62,-12.89],[1,195.15,-14.89],[2,112.88,24.53,2,15],[2,190.58,2.07,2,10],[3,112.77,43.67]],[[0,19.01,3.48],[0,19.3,7.9],[0,19.36,11.64],[0,179.07,21.9],[0,179.96,16.53],[0,178.69,11.04],[1,-7.64,-1.95],[2,68.43,-.84,2,15],[3,40.85,43.98]],[[0,16.97,4.09],[0,18.83,-7.5],[0,17.7,-1.65],[0,19.95,-13.2],[1,46.07,-15.12]],[[0,8.4,2.52],[0,10.55,7.24],[0,13.68,10.53],[0,18.44,13.16],[0,-12.62,-20.86],[0,-13.11,-16.42],[0,-14.92,-12.64],[0,-54.7,-20.69],[0,-53.71,-16.42],[0,-52.07,-11.98],[1,-33.99,-65.41]],[[0,91.48,-34.15],[0,64.03,-49.66],[0,116.34,-16.44],[0,102.62,10.6],[0,100.98,14.67],[0,7.54,2.84],[0,8.53,8.21],[0,10.92,12.59],[0,32.4,-63.59],[1,32.09,-77.37],[3,49.71,25.12]],[[0,55.01,-20.39],[0,54.89,-16.94],[0,54.59,-13.7],[0,25.98,2.39],[0,26.66,5.6],[0,28.01,8.55],[0,96.19,-84.77],[0,116.14,-56.37],[0,129.24,-85],[0,130.35,-80.06],[0,131.71,-75.37],[0,133.32,-71.17],[0,135.42,-66.23],[0,137.39,-61.78],[0,139.62,-57.83],[0,142.09,-54],[0,145.17,-50.05],[0,148.02,-46.59],[0,151.1,-43.38],[1,62.3,-182.08],[2,105.37,-22.02,2,15],[2,271.34,-76.84,2,40]]][v],g.lP(w);let e=g.eS(35633),t=g.eS(35632);w=g.eP(),g.aS(e,'attribute vec4 a;void main(){gl_Position=a;}'),g.me(e),g.aS(t,'precision highp float;'+'uniform sampler2D T,S;uniform vec4 t,s,r;float x(vec2 x){return x=17.*fract(x*.31831+.1),fract(x.x*x.y*(x.x+x.y));}int v;float n(vec2 v){vec2 y=floor(v),m=fract(v);m=m*m*(3.-2.*m);return mix(mix(x(y+vec2(0,0)),x(y+vec2(1,0)),m.x),mix(x(y+vec2(0,1)),x(y+vec2(1,1)),m.x),m.y);}float f(vec2 x){if(v>0)x.x=.25*sin(x.x);mat2 m=mat2(.88,.48,-.48,.88);float y=.5*n(x*=8.);y+=.25*n(x=m*x*2.01);y+=.125*n(x=m*x*2.02);y+=.0625*n(x=m*x*2.03);return y;}float f(float x,float f){return max(min(x,f),0.)-length(min(vec2(x,f),0.));}float f(vec2 x,float v,float y,float m){return length(x-vec2(v,y))-m;}float f(vec2 x,float v,float y,float m,float f,float w){vec2 d=abs(x-vec2(v,y))-vec2(m,f)*.5;return length(max(d,0.))+min(max(d.x,d.y),0.);}float f(vec2 x,float v,float y,float m,float f,float w,float l){vec2 d=vec2(v,y),z=vec2(f,w)-d;x-=d;float n=dot(z,z),e=m-l;vec2 i=vec2(dot(x,vec2(z.y,-z.x)),dot(x,z))/n,a=vec2(sqrt(n-e*e),e);i.x=abs(i.x);float c=a.x*i.y-a.y*i.x,p=dot(i,i);return c<0.?sqrt(n*p)-m:c>a.x?sqrt(n*(p+1.-2.*i.y))-l:dot(a,i)-m;}vec2 M0(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,11.43,101.05,192.,200.,0.));v.x=f(v.x,f(x,111.93,78.66,50.));v.x=f(v.x,f(x,26.58,-2.89,25.,127.67,-4.64,25.));return-1.-v;}vec2 M1(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,19.38,52.48,50.,100.,0.));v.x=max(v.x,-f(x,72.93,52.48,30.,100.,0.));return-1.-v;}vec2 M2(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,-6.05,55.81,100.,125.,0.));v.x=f(v.x,f(x,-17.47,-12.52,50.,30.,0.));v.x=f(v.x,f(x,-61.74,-2.12,10.,-15.66,-2.12,10.));return-1.-v;}vec2 M3(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,-.07,97.01,150.,250.,0.));v.x=f(v.x,f(x,47.9,-32.4,20.,-48.89,-32.43,20.));v.x=f(v.x,f(x,-11.32,-17.57,40.,40.,0.));v.x=f(v.x,f(x,-16.8,-1.87,10.,-50.28,-11.81,20.));return-1.-v;}vec2 M4(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,70.66,77.64,150.,150.,0.));v.x=f(v.x,f(x,65.84,55.43,31.,150.,0.));v.x=f(v.x,f(x,106.59,-4.28,20.,23.88,-4.59,20.));return-1.-v;}vec2 M5(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,44.34,48.78,98.1,94.01,0.));v.x=f(v.x,f(x,44.24,1.15,40.99));v.x=max(v.x,-f(x,43.92,-6.14,31.58));return-1.-v;}vec2 M6(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,-81.57,63.3,186.89,121.37,0.));v.x=max(v.x,-f(x,-179.33,81.59,50.,84.77,0.));v.x=max(v.x,-f(x,86.89,3.76,154.4,245.33,0.));v.x=f(v.x,f(x,-91.59,-3.02,50.,35.76,0.));v.x=f(v.x,f(x,-24.02,.77,17.11));v.x=f(v.x,f(x,-47.7,4.65,13.44));v.x=f(v.x,f(x,-143.51,28.24,21.01));v.x=f(v.x,f(x,-66.33,11.06,15.48));v.x=f(v.x,f(x,-118.47,18.92,14.61));v.x=f(v.x,f(x,-93.42,19.8,19.27));v.x=f(v.x,f(x,-168.27,34.65,14.02));v.x=f(v.x,f(x,-137.5,-.18,88.66,56.58,0.));return-1.-v;}vec2 M7(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,4.15,43.37,300.,300.,0.));v.x=f(v.x,f(x,34.45,6.64,17.83));v.x=f(v.x,f(x,-37.15,10.44,17.83));v.x=f(v.x,f(x,.9,38.33,33.77,-.17,2.73,19.));v.x=max(v.x,-f(x,.09,6.28,3.37,.23,28.86,22.));return-1.-v;}vec2 M8(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,34.88,30.21,94.56,56.,0.));v.x=max(v.x,-f(x,72.57,18.35,39.11,79.54,0.));return-1.-v;}vec2 M9(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,18.02,57.64,50.,110.,0.));v.x=max(v.x,-f(x,89.57,42.,50.,110.,0.));v.x=max(v.x,-f(x,99.5,-32.11,30.,10.,0.));return-1.-v;}vec2 MA(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,32.26,57.5,78.48,110.29,0.));v.x=max(v.x,-f(x,204.79,72.98,170.1,145.49,0.));v.x=max(v.x,-f(x,238.47,-62.76,103.2,132.51,0.));v.x=f(v.x,f(x,186.82,-14.81,19.64));v.x=f(v.x,f(x,69.71,1.22,45.61,15.62,0.));v.x=f(v.x,f(x,109.87,-3.83,13.73,137.12,13.48,14.86));v.x=f(v.x,f(x,53.8,24.17,18.27,98.27,.24,7.));return-1.-v;}vec2 MB(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,-37.78,111.78,150.,250.,0.));v.x=f(v.x,f(x,10.19,-17.63,20.,-112.46,-17.07,20.));v.x=f(v.x,f(x,-49.04,.05,40.,46.01,0.));v.x=f(v.x,f(x,-67.5,15.4,19.97,-121.84,15.23,20.));return-1.-v;}vec2 MC(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,21.99,7.92,300.,300.,0.));v.x=f(v.x,f(x,-2.96,-14.13,16.57,39.05,-13.99,16.22));v.x=f(v.x,f(x,17.3,4.69,16.91,17.84,-31.63,16.83));return-1.-v;}vec2 MD(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,45.89,34.25,100.82,64.41,0.));v.x=max(v.x,-f(x,139.23,-50.95,97.76,83.02,0.));v.x=f(v.x,f(x,112.32,-8.,18.32,164.92,-7.38,19.13));v.x=f(v.x,f(x,76.77,1.57,15.46,109.6,12.15,4.75));v.x=f(v.x,f(x,47.63,-4.25,15.9,18.,-9.89,17.89));v.x=max(v.x,-f(x,115.26,-5.19,9.1,163.8,-5.3,12.67));return-1.-v;}vec2 ME(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,53.48,38.82,129.68,73.84,0.));v.x=max(v.x,-f(x,213.53,-15.55,113.32,182.21,0.));v.x=f(v.x,f(x,163.85,16.56,18.59));v.x=f(v.x,f(x,99.87,18.08,27.15,76.56,-22.49,13.31));v.x=f(v.x,f(x,63.62,6.32,93.34,17.12,0.));v.x=f(v.x,f(x,36.04,18.81,20.75,58.99,-23.85,5.62));return-1.-v;}vec2 MF(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,-.48,30.21,23.82,56.,0.));v.y=max(v.y,-f(x,17.31,30.83,9.17,47.52,0.));v.x=max(v.x,-f(x,36.35,23.07,26.2,69.39,0.));return-1.-v;}vec2 MG(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,26.,31.55,76.82,58.69,0.));v.x=max(v.x,-f(x,-33.82,19.82,50.,82.48,0.));v.x=f(v.x,f(x,-33.82,-22.67,23.9));v.x=f(v.x,f(x,73.44,-2.32,19.03,23.69,-2.18,18.9));v.y=max(v.y,-f(x,-34.06,-28.47,9.41,7.92,0.));v.y=max(v.y,-f(x,75.73,7.27,11.45,10.56,0.));return-1.-v;}vec2 MH(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,71.31,40.04,154.04,75.27,0.));v.x=f(v.x,f(x,123.01,-.08,62.94,23.22,0.));v.x=f(v.x,f(x,90.44,6.87,15.38,26.29,.37,21.91));v.y=max(v.y,-f(x,120.34,-5.81,7.));v.y=max(v.y,-f(x,91.29,-22.92,7.));v.y=max(v.y,-f(x,63.25,-38.83,7.));v.y=max(v.y,-f(x,32.02,-52.75,7.));return-1.-v;}vec2 MI(vec2 x){vec2 v=vec2(-10000);v.x=max(v.x,-f(x,39.98,43.37,104.77,130.66,0.));v.x=max(v.x,-f(x,184.77,3.19,124.61,211.16,0.));v.y=max(v.y,-f(x,116.24,-48.67,10.,10.,0.));v.y=max(v.y,-f(x,95.28,-75.1,7.));v.x=max(v.x,-f(x,306.31,-200.32,185.13,157.26,0.));v.y=max(v.y,-f(x,100.28,-157.86,10.,10.,0.));v.x=f(v.x,f(x,209.81,-101.05,84.85,281.55,-102.25,23.59));v.x=f(v.x,f(x,98.67,-22.99,16.65,73.85,-23.84,17.34));v.x=f(v.x,f(x,4.31,-20.09,50.,44.52,0.));v.x=f(v.x,f(x,39.92,1.43,16.33,39.04,-32.99,18.53));v.x=max(v.x,-f(x,149.39,-163.71,5.,226.38,-163.59,4.88));return-1.-v;}float m(vec2 x){vec2 v=M(x);return min(v.x,v.y);}vec4 m(vec2 x,float v){vec2 y=vec2(v,0),f=M(x);float z=m(x-y.xy),n=m(x+y.xy),w=m(x-y.yx),d=m(x+y.yx);return vec4(normalize(vec2(n-z,d-w)),min(f.x,f.y),.25*(float(z<=0.)+float(n<=0.)+float(w<=0.)+float(d<=0.))*(f.y<f.x?-1.:1.));}vec3 f(float x,float v,vec2 y){return vec3(1,.9,.7)*smoothstep(x,v,f(.1*y))+vec3(.7,.9,1)*smoothstep(x,v,f(.1*y+9.))+vec3(.12,.08,.12)*f(.0015*y+5.);}void main(){v=0;if(t.z==0.){vec2 x=M(t.xy);gl_FragColor=gl_FragCoord.x<1.?vec4(m(t.xy,.01).xyz,x.y<x.x?1.:0.):m(t.xy+vec2(0,.5),.01);}else{vec2 x=gl_FragCoord.xy-.5*vec2(1024,768),y=gl_FragCoord.xy/vec2(1024,768),i;y.y=1.-y.y;x.y*=-1.;i=.2*x+.2*t.xy;x=x/t.z/21.+t.xy;vec4 n=texture2D(T,y),d=texture2D(S,y),z=m(x,.5/t.z/21.);vec3 w=vec3(0);if(z.w!=0.){float e=pow(max(0.,1.+.5*z.z),3.);if(z.w<0.)w=-z.w*(.1+.25*e)*vec3(.5);else{vec2 l=vec2(.3,0.),p=e>.01?i+20.*z.xy*e:i;w=.25*f(.73,.9,p+l.xy)+.25*f(.73,.9,p-l.xy)+.25*f(.73,.9,p+l.yx)+.25*f(.73,.9,p-l.yx);vec2 a=e>.01?.05*x+.2*vec2(z.y,-z.x)*e:.05*x;float c=fract(2.*(sin(a.x)+a.y));vec3 o=(.5+.5*smoothstep(.2,.3,c)*smoothstep(.8,.7,c))*r.xyz;w+=z.w*(.1+.5*e)*o;}}else w=f(.73,.9,i);vec2 a=2.*n.yz-1.;float e=length(a),p=max(0.,1.-e);if(n.x>25./255.){w+=p*exp(-3.*e)*8.*vec3(.12,.08,.12);if(s.w>.5){float c=clamp((n.x-.117647)/.117647,0.,1.);w+=c*p*exp(-10.*length(a))*5.*f(0.,1.,8.*vec2(atan(a.y,a.x)+.05*t.w,5.*(p-.05*t.w)));}}else if(n.x>15./255.){w-=pow(p,2.);vec2 c=vec2(atan(a.y,a.x)+.05*t.w,p-.01*t.w);v=1;vec3 l=vec3(.12,.08,.12)*mix(f(c),f(c+vec2(1.57,0)),.5);v=0;w+=(1.-exp(-5.*e))*p*10.*l;}else if(n.x>5./255.)w+=smoothstep(0.,.3,p)*10.*vec3(1,1,.5)*exp(-(8.+2.*sin(.5*t.w+(x.x+x.y)))*e);float c=d.x;w+=vec3(c)+vec3(1,1,.5)*pow(.5*max(0.,2.-length(x-s.xy)),2.75+.25*sin(.3*t.w));if(d.z>0.)w=clamp(w,0.,1.);w+=(vec3(.3)+f(.3,1.,x+9.+.05*t.w))*(d.y+.75*d.z);if(d.z>0.&&d.z<.5)w=mix(w,10.*d.z*vec3(.12,.08,.12),.5);gl_FragColor=vec4(min(vec3(1),w)*s.z,1);}}'.replace('M'+v.toString(36).toUpperCase(),'M')),g.me(t),g.attachShader(w,e),g.attachShader(w,t),g.no(w),g.lS(t),g.lS(e),g.eg(w)},$=0,j=10,K=(x,e)=>(D=[0,0],E=_=R=F=S=q=N=P=0,G=x?v:{},B=[],{v:$&&!x?1e3:0,t:0,l:x?1.5:3,o:[0,0],m:0,i:1,g:$&&!x?[106.4,18.7]:[0,0],M:0,h:0,u:0,p:0,A:x?0:e}),Q=(x,v,e)=>({v:f(x.v,v.v,e),t:f(x.t,v.t,e),l:f(x.l,v.l,e),o:a(x.o,v.o,e),m:v.m,i:v.i,g:a(x.g,v.g,e),M:t(x.M,v.M,e),h:v.h,u:v.u,p:f(x.p,v.p,e),A:v.A}),V=(e,o,i,M)=>{let h=Q(e,e,0),d=0;if(h.v++,q>0&&q--,0==h.h?1>h.t&&(h.t+=.1):0>h.t||(h.t-=2==h.h?.04:.1),o)v[27]&&0==h.h&&(h.h=3);else if($=1,G=h.v>15&&25>h.v?{39:1,38:1}:{},h.v>200&&2!=h.h){let x=()=>y(...[1.56,.1,367,.01,.07,.08,1,.5,-4,,,,,,,,.09,0,.05]);v[37]&&(x(),h.A--),v[39]&&(x(),h.A++),v[38]&&(x(),h.A-=6),v[40]&&(x(),h.A+=6),h.A=Math.max(0,Math.min(Math.min(17,M),h.A)),v[13]&&(y(...[2,0,1,.1,.3,1,3,.6,,.6,30+o%2*5,,.35,,,,.18,.78,.1,.46]),h.h=2)}if(2==h.h)h.u++,h.g[0]+=D[0],h.g[1]+=D[1];else{if(P)k+=L,N=r([0,0],[Math.cos(k),Math.sin(k)],U),h.g=r(N,P,1),D=r([0,0],r(h.g,e.g,-1),.5),(G[38]||G[40])&&(y(...[1.47,,115,.02,.07,,1,.37,6.3,,,,,,,,.03,.79,.01]),D=r([0,0],D,1.3),P=0,S=0,q=5);else{let v=0;h.t>.99&&0==h.h&&(G[38]&&S&&(D[1]-=.3,S=0,y(...[1.43,,1487,,.03,.12,,.61,45,2.5,,.03,,.7,,.2,.05])),G[40]&&!F&&(y(...[1.56,.1,367,.01,.07,.08,1,.5,-4,,,,,,,,.09,0,.05]),.5>D[1]&&(D[1]=.5)),v=G[37]?-.015:G[39]?.015:0,_|=v?1:0,-1e-4>v*D[0]?v*=3:Math.abs(D[0])>.5&&(v=0),!S||G[37]||G[39]||(v=Math.abs(D[0])>.005?.005*-Math.sign(D[0]):-D[0]),G[37]&&(h.i=-1),G[39]&&(h.i=1)),N&&!U||(S&&Math.sign(X[0])==Math.sign(v)&&(v*=l([0,-1],X)),D[0]+=v,q||(D[1]+=.027+(G[40]&&D[1]>0?.027:0))),D[1]>1&&(D[1]=1),h.g=r(h.g,D,1),h.g[0]+=D[0],h.g[1]+=D[1],(x=>{g.na(36160,s),g.nx(3553,null),g.uniform4f(g.tfn(w,'t'),x[0],x[1],0,0),g.nf(34962,u);let v=g.tr(w,'a');g.aVb(v),g.rAe(v,2,5120,!1,0,0),g.ar(4,0,3)})(h.g),N=0;for(let v=0;x.length>v;++v)if(o&&2==x[v][0]){let e=[x[v][1],x[v][2]],t=r(h.g,e,-1),f=l(t,t);if(x[v][4]*x[v][4]>f&&(N=t,!U&&l(N,D)>0)){let x=Math.sqrt(f);y(...[1.08,,79,.05,.49,.67,,.45,,,1,.1,.16,,,.1,,.64,.04,.28]),P=e,k=Math.atan2(N[1],N[0]),U=x,L=2*Math.sqrt(l(D,D))/x*Math.sign((p=D)[1]*(z=N)[0]-p[0]*z[1]),G[40]&&(G[40]=0)}}N||(U=0),g.ax(0,0,2,1,6408,5126,Z),X=[Z[0],Z[1]];let e=Z[3];S||-.1>X[1]?(1.5>Z[2]?d=Math.atan2(Z[4],-Z[5]):(d=t(h.M,0,.25),S>0&&S--),1>Z[2]&&(S||(R?.5>e&&y(...[2,,80,.01,.03,.18,1,.3,-.2,-11.6,,,,,,,,,.01]):R=1),D=m(D,X,e,1),h.g=r(h.g,X,1-Z[2]),e>.5?y(...[1.5,,355,.03,,.45,1,.9,,,120,.19,.06,.2,6.9,,,.9,.02]):S=5)):(d=t(h.M,0,.25),1>Z[2]&&(D=m(D,X,e,1),h.g=r(h.g,X,1-Z[2]),e>.5&&y(...[1.5,,355,.03,,.45,1,.9,,,120,.19,.06,.2,6.9,,,.9,.02])))}P||N&&!U?(h.M=t(h.M,Math.atan2(N[0],-N[1]),.75),h.m=2):(h.M=d,h.m=S?0:G[40]?2:1),(o&&h.g[1]>j||G[82])&&(h.h=1)}var p,z;B.push([D[0],D[1]]),B.length>30&&B.shift();let A=B.reduce(((x,v)=>r(x,v,1)),[0,0]);if(o&&_&&h.l>.7&&(h.l-=.01),h.o=r([h.g[0],h.g[1]],A,10/30),h.o[1]=Math.min(h.o[1],j-10),!o){h.o=a(h.o,[155,32],n(100,300,h.v));let x=n(50,300,h.v);if(h.l=f(3,.4,1-(1-x)*(1-x)),!v[0])return h.v=0,h}1>x.filter((x=>!x[0])).length&&h.p++,j=20;for(let v=0;x.length>v;++v){let e=r(h.g,x[v].slice(1),-1),t=l(e,e);if(3==x[v][0]&&(j=x[v][2]),1==x[v][0]&&(2==h.h&&(D=r([0,0],D,.8)),h.p&&9>t&&2!=h.h&&(y(...[2,0,1,.1,.3,1,3,.6,,.6,30+o%2*5,,.35,,,,.18,.78,.1,.46]),h.h=2,i[o-1]&&h.v>i[o-1]||(i[o-1]=h.v-1))),!x[v][0]&&(16>t&&(x[v][1]+=e[0]*Math.min(1,.5/t),x[v][2]+=e[1]*Math.min(1,.5/t)),3>t)){let e=180*Math.pow(2,[0,2,5,7][E]/12);E=(E+1)%4,y(...[,0,e,.05,,.25,1,1.67,,,,,,,9,.1,,.71,.15]),x.splice(v,1),v--}}return F=G[40],h},W=0,xx=(()=>{let x=0,v=0,e=0,t=0,f=0,a=0,r=0,l=0;return(o,m,n)=>{let y=2*Math.PI*o/11025,i=Math.sin(y),M=Math.cos(y),h=i*Math.sinh(Math.log(2)*y/i),s=1-M,u=1+h;f=s/2/u,a=s/u,r=-2*M/u,l=(1-h)/u,n[0]=f*m[0]+a*x+f*v-r*e-l*t,n[1]=f*m[1]+a*m[0]+f*x-r*n[0]-l*e;for(let x=2;512>x;++x)n[x]=f*m[x]+a*m[x-1]+f*m[x-2]-r*n[x-1]-l*n[x-2];x=m[511],v=m[510],e=n[511],t=n[510]}})(),vx=new Float32Array(512),ex=new Float32Array(512),tx=new Float32Array(512),cx=0,fx=0,ax=()=>{let x=new(window.AudioContext||window.webkitAudioContext)({sampleRate:11025}),v=x.createScriptProcessor(512,0,1);v.connect(x.destination),v.onaudioprocess=x=>(x=>{if(0>W)W=0;else{for(let x=0;512>x;++x){let v=(W+x)/11025;vx[x]=2*Math.random()-1,tx[x]=.75*Math.sin(195*v*Math.PI)*Math.sin(.1*v),tx[x]+=.75*Math.sin(218.88009942*v*Math.PI)*Math.cos(.19*v),tx[x]+=.75*Math.sin(260.29377156*v*Math.PI)*Math.sin(.39*v),tx[x]+=.25*Math.sin(390*v*Math.PI)*Math.sin(.03*v)}xx(150+25*Math.sin(2e-5*W),vx,ex);for(let v=0;512>v;++v)x[v]=fx*cx*.3*(.5*ex[v]+.3*tx[v]);1>cx&&(cx+=.1),W+=512}})(x.outputBuffer.getChannelData(0)),ax=()=>{}},rx=0,lx=NaN,ox=0,mx=[],nx=()=>{requestAnimationFrame(nx);let e=performance.now();for(isNaN(lx)&&(lx=e),rx+=Math.min(e-lx,1e3),lx=e;rx>33;)rx-=33,O=I,I=V(I,ox,mx,T),0===(t=I.m)&&(A=0),1===t&&(A+=1)>12&&(A-=4),2===t&&(12>A&&(A=12),(A+=1)>17&&(A=17)),v[38]=0,ox||2==I.h||(v[40]=v[37]=v[39]=0);var t;if(((v,e,t)=>{g.na(36160,null),c[c.ly]='#000',c[c.lc](0,0,1024,768);let f=c[c.oC];c.globalCompositeOperation='lighter';for(let v=0;x.length>v;++v){if(3==x[v][0])continue;let e=x[v][1],f=x[v][2],a=1==x[v][0]?4:2==x[v][0]?x[v][4]:1;c.save(),c.translate(512+21*(e-t.o[0])*t.l,384+21*(f-t.o[1])*t.l),c[c.a](21*t.l*a,21*t.l*a);let r=10+[0,20+t.p|0,10][x[v][0]];r=Math.min(255,r).toString(16),c[c.ly]=`#${(2>r.length?'0':'')+r}0000`,c[c.lc](-1.1,-1.1,2.2,2.2),c[c.ly]=C,c[c.lc](-1.1,-1.1,2.2,2.2),c[c.ly]=b,c[c.lc](-1.1,-1.1,2.2,2.2),c[c.ee](-1.2,-1.2,.2,2.4),c[c.ee](-1.2,-1.2,2.4,.2),c[c.ee](1,-1.2,.2,2.4),c[c.ee](-1.2,1,2.4,.2),c[c.se]()}if(g.tT(33984),g.nx(3553,M),g.xg(3553,0,6408,6408,5121,C1),c[c.oC]=f,c[c.ly]='#000',c[c.lc](0,0,1024,768),(x=>{c[c.rS]='#f00',c[c.np]='round';for(let v=0;d.length>v;++v){let e=d[v],t=0,f=0;if(e.length>1){for(f=1;e.length-1>f&&A>=e[f][0];)f++;t=f-1}let a=e[t],r=e[f],l=t==f?0:(A-a[0])/(r[0]-a[0]),o=a[1]&&r[1]?z(a,r,l):a;o[1]&&(c.save(),c.translate(512+21*(x.g[0]-x.o[0])*x.l,384+21*(x.g[1]-x.o[1])*x.l),c[c.a](.075*x.l,.075*x.l),c[c.t](x.M),c.translate(x.i*o[2],o[3]),c[c.a](x.i,1),c[c.t](o[4]),o[5].forEach((x=>p[x[0]](x))),c[c.se]())}})(t),J[v]&&(c.save(),c[c.xi]='left',c.translate(512-21*t.o[0]*t.l,384-21*t.o[1]*t.l),c[c.a](t.l,t.l),c[c.rS]='#030',c[c.nd]=8,c[c.ni]='round',c[c.ly]='#0f0',c.font='italic bold 42px Arial',c[c.rT](J[v],-315,-189),c[c.lx](J[v],-315,-189),c[c.se]()),v)c.save(),c[c.ly]='#f00',c.font='32px Courier',c[c.xi]='right',c[c.lx](o(t.v-t.u),1010,42),c[c.se]();else{c.save(),c.translate(512-21*t.o[0]*t.l,384-21*t.o[1]*t.l),c[c.a](t.l,t.l),c[c.ly]='#0f0',c[c.rS]='#030',c[c.nd]=25,c[c.ni]='round',c[c.xi]='center',c.font='italic bold 378px Arial',c[c.rT]('GALAXY',3255,168),c[c.rT]('RIDER',3255,483),c[c.lx]('GALAXY',3255,168),c[c.lx]('RIDER',3255,483),c.font='84px Arial',c[c.lx]('Use Arrows and Enter to Select Level',3255,1512),c[c.se]();for(let x=0;18>x;++x){c.save(),c.translate(512-21*t.o[0]*t.l,384-21*t.o[1]*t.l),c[c.a](t.l,t.l),c[c.ly]=c[c.rS]=x==t.A?'#00f':x>e.length?'#003':'#007',c[c.nd]=21*(x==t.A?1:.25);let v=115+x%6*14,f=33+10*(x/6|0);c[c.rR](21*v,21*f,252,168),c.font=(x==t.A?'bold ':'')+'63px Courier',c[c.xi]='center',c[c.lx](x+1,21*(v+6),21*(f+3)),c.font='bold 53px Courier',e.length>x&&c[c.lx](o(e[x]),21*(v+6),21*(f+7)),c[c.se]()}}var a;g.tT(33985),g.nx(3553,i),g.xg(3553,0,6408,6408,5121,C1),g.uniform1i(g.tfn(w,'T'),0),g.uniform1i(g.tfn(w,'S'),1),g.uniform4f(g.tfn(w,'t'),t.o[0],t.o[1],t.l,t.v),g.uniform4f(g.tfn(w,'s'),t.g[0],t.g[1],t.t,t.p),g.uniform4fv(g.tfn(w,'r'),(x=>{let v,g,e,t=.84,f=.36;return v=Y(f,t,x+1/3),g=Y(f,t,x),e=Y(f,t,x-1/3),[v,g,e,0]})((0==(a=v)&&(a=1),(.85-.25*((a-=1)/7|0)+(a%=7)/7*.1)%1))),g.nf(34962,u);let r=g.tr(w,'a');g.aVb(r),g.rAe(r,2,5120,!1,0,0),g.ar(4,0,3)})(ox,mx,Q(O,I,rx/33)),fx=I.t,0>I.t){let x=Math.min(17,mx.length);T=mx.length,3==I.h?(x=ox-1,ox=0):ox?(2==I.h&&(window.localStorage.setItem('galaxyrider',JSON.stringify(mx)),ox++),ox%=19,0===ox&&alert('Congrats!')):ox=I.A+1,I=O=K(ox,x),lx=NaN,H(ox)}},yx=window.localStorage.getItem('galaxyrider');yx&&(mx.length=0,mx.push(...JSON.parse(yx))),g.te('OES_texture_float'),i=g.eT(),g.nx(3553,i),g.xg(3553,0,6408,1024,768,0,6408,5121,null),g.texParameteri(3553,10241,9728),g.texParameteri(3553,10240,9728),g.texParameteri(3553,10242,33071),g.texParameteri(3553,10243,33071),M=g.eT(),g.nx(3553,M),g.xg(3553,0,6408,1024,768,0,6408,5121,null),g.texParameteri(3553,10241,9728),g.texParameteri(3553,10240,9728),g.texParameteri(3553,10242,33071),g.texParameteri(3553,10243,33071),h=g.eT(),g.nx(3553,h),g.xg(3553,0,6408,2,1,0,6408,5126,null),g.texParameteri(3553,10241,9728),g.texParameteri(3553,10240,9728),g.texParameteri(3553,10242,33071),g.texParameteri(3553,10243,33071),s=g.eF(),g.na(36160,s),g.aue(36160,36064,3553,h,0),u=g.eB(),g.nf(34962,u),g.fD(34962,Uint8Array.of(1,1,1,128,128,1),35044),I=O=K(ox,Math.min(17,T=mx.length)),H(ox),nx(),C0.onmousedown=()=>{ax(),v[0]=1};">html,body,canvas{background:#222;margin:0;overflow:hidden}#C1{display:none}canvas{cursor:pointer;border:10px solid #333;position:absolute;max-width:100%;max-height:100%;top:50%;left:50%;transform:translate(-50%,-50%)