Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

566 ;(

A topic by TGY created May 07, 2020 Views: 181 Replies: 4
Viewing posts 1 to 5
Submitted

I cannot compress more properly and I am only 6 chars from limit. If any1 wanna help:

<body onload="c=a.getContext`2d`;z=a.height=300;l=260;k=j=s=f=0;with(c){C=e=>{k=40+Math.random()*l;j=40+Math.random()*l};p=(e,q)=>{beginPath();arc(e,q,5,0,0.1,1);fill();};t=e=>{fillStyle=e};d=e=>{t`#00B`;fillRect(0,0,z,l);t`#0C0`;fillRect(0,l,z,40);t`red`;p(k,j);};}d();C();onclick=e=>{if(f)return 0;f++;v=7;y=l;x=0;with(Math){n=atan2(e.clientY-z,e.clientX);h=v*cos(n);I=setInterval(e=>{r=v*sin(n);x+=h;y+=r;d();t`#FFF`;p(x,y);if((x-k)*(x-k)+(y-j)*(y-j)<100){C();s++}r+=0.1;n=atan2(r,h);v=sqrt(r*r+h*h);if(x<0||x>z||y>z){clearInterval(I);f=0}},10);}};"><canvas id=a>

Submitted

I would just keep the ball's color to be the same as the goal's. So just remove t`#FFF`; and you'll be at 558 characters. Alternatively, you could also change the goal to the ball's color (#FFF) and again, remove the ball's color change to be at exactly at 560.

Submitted (1 edit) (+1)

563 char without touching anything, i just removed some ';', optimized an 'if' and wrote '0.1' as '.1', ENJOY! Searching for the last 3 char to remove ...


<body onload="c=a.getContext`2d`;z=a.height=300;l=260;k=j=s=f=0;with(c){C=e=>{k=40+Math.random()*l;j=40+Math.random()*l};p=(e,q)=>{beginPath();arc(e,q,5,0,.1,1);fill()};t=e=>{fillStyle=e};d=e=>{t`#00B`;fillRect(0,0,z,l);t`#0C0`;fillRect(0,l,z,40);t`red`;p(k,j)};}d();C();onclick=e=>{if(f)return 0;f++;v=7;y=l;x=0;with(Math){n=atan2(e.clientY-z,e.clientX);h=v*cos(n);I=setInterval(e=>{r=v*sin(n);x+=h;y+=r;d();t`#FFF`;p(x,y);if((x-k)*(x-k)+(y-j)*(y-j)<100)C(),s++;r+=0.1;n=atan2(r,h);v=sqrt(r*r+h*h);if(x<0||x>z||y>z){clearInterval(I);f=0}},10)}};"><canvas id=a>

Submitted(+2)

550, you can add new feature 8ppppppppppp


<body onload="c=a.getContext`2d`;z=a.height=300;l=260;k=j=s=f=0;with(c){C=e=>{k=40+Math.random()*l;j=40+Math.random()*l};p=(e,q)=>{beginPath();arc(e,q,5,0,.1,1);fill()};t=e=>{fillStyle=e};d=e=>{t`#00B`;fillRect(0,0,z,l);t`#0C0`;fillRect(0,l,z,40);t`red`;p(k,j)}}d();C();onclick=e=>{if(f)return 0;f++;v=7;y=l;x=0;with(Math){n=atan2(e.y-z,e.x);h=v*cos(n);I=setInterval(e=>{r=v*sin(n);x+=h;y+=r;d();t`#FFF`;p(x,y);if((x-k)*(x-k)+(y-j)*(y-j)<100)C(),s++;r+=0.1;n=atan2(r,h);v=sqrt(r*r+h*h);if(x<0||x>z||y>z){clearInterval(I);f=0}},10)}};"><canvas id=a>

Submitted(+2)

Thank you guys a lot!