Play game
Gravity's itch.io pageHow many characters of code did you use?
499
Include your code here, if you'd like to show it off!
<canvas id=c><<script>m=e=>{X.push(e.x-10);Y.push(e.y-10)};i=Math;X=[];Y=[];c=c.getContext('2d');h=x=150;y=75;M=0;z=0;k=0;t=setInterval(()=>{with(c){onmousedown=m;fillStyle='#22222220';fillRect(0,0,300,h);for(j=0;j<X.length;j++){d=X[j]-x+.1;z+=i.sign(d)*6e-3/d*d;d=Y[j]-y+.1;k+=i.sign(d)*6e-3/d*d;fillStyle='#cc0';fillRect(X[j],Y[j],3,3)}x+=z;y+=k;fillStyle='#fff';fillRect(x,y,5,5);v=i.sqrt(z*z+k*k)*10;M=v>M?v|0:M;fillText("MAX: "+M,5,19);!(x>0&&x<300&&y>0&&y<h)&&clearInterval(t)}},16);</script>
Leave a comment
Log in with itch.io to leave a comment.
Comments
No one has posted a comment yet