Objective must be pretty clear - tap at the screen to send lazer beam in that direction, try to gain highest score (mine is Infinity). 

This game was created for #TweetTweetJam, which means it`s done in under 560 chars of code (553 exactly). I written it in pure Javascript:

<p id=p></p><canvas id=a><script>c=a.getContext`2d`;Z=a.height=a.width=800;z=x=y=Z/2;u=10 Math.random()*280;v=10 Math.random()*280;s=n=undefined;t=e=>{c.fillStyle=e};onload=c.fillRect(0,0,Z,Z);I=setInterval(e=>{if(n!=undefined){x =5*Math.cos(n);y =5*Math.sin(n)}t`blue`;c.beginPath();c.arc(v,u,10,0,0.1,1);c.fill();t`red`;c.fillRect(x-2,y-2,4,4);if(x<0||x>Z)n=3.14-n;if(y<0||y>Z)n=6.28-n;if(s!=undefined)p.innerHTML=s ;if((x-v)*(x-v) (y-u)*(y-u)<100)clearInterval(I)},1);onclick=e=>{if(n==undefined){n=Math.atan2(e.clientY-z,e.clientX-z);s=0}}</script>

Leave a comment

Log in with itch.io to leave a comment.