Skip to content

Instantly share code, notes, and snippets.

View liamstrilchuk's full-sized avatar

Liam Strilchuk liamstrilchuk

  • Ontario, Canada
View GitHub Profile
@gullyn
gullyn / breakout.html
Last active June 5, 2021 11:25
Breakout in 360 bytes
<body onload="u=l=m.getContext`2d`;onkeydown=e=>k=e.which-38;setInterval(`l||b>w?(q=k=l=0,a=p=v=50,b=5e2,c=d=2):p+=k*2;m.width=m.height=w=610;a+=c-=a<0|a>w?2*c:0;b-=d-=b<0|(a>p&a<p+v&b>590)?d*2:0;for(i=-1;++i<30;x=i%10*60,y=~~(i/10)*20,!(q&2**i)&&${f='u.fillRect('}x,y,v,j=15),x<a&a<x+v&b>y&b<y+j&&(q|=2**i,d=-d));${f}p,590,v,j);${f}a,b,9,9)`,9)"><canvas id=m>