Jackpot (itch)
About
Game:
Left click on the window when the moving dot is in position of the red dot to gain points. Difficulty increases as score increases. Missing the mark ends the game, refresh window to restart.
beat my high score of 44!
Code:
<canvas id=c width=1000></canvas><script>d=document;c=d.getElementById("c");x=c.getContext("2d");x.font="19px Sans";j=q=>{v=Math.floor(Math.random()*30)};b="⚪";t="🔴";a="⚫";l=[];y=0.1;while(l.length<30)l.push(b);j();n=1000;s=i=o=0;d.addEventListener("click",e=>{clearInterval(h);if(!l.includes(t)){s++;y-=0.002;j();z()}});u=q=>{l[v]=t;x.fillStyle="white";x.fillRect(0,0,n,50);x.fillStyle="black";l[o]=b;l[i]=a;x.fillText(s,1,30);x.fillText(l.join(" "),40,30);o=i;i++;if(i==l.length)r=!0;if(i==1)r=!1;if(r)i-=2};(z=q=>{h=setInterval(u,y*n)})();</script>
Download by creating a txt file and copying and pasting the code, rename file extension to .html and drag and drop into browser.
dont use notepad
Recommended:
Play on: https://codepen.io/bytestats/pen/bQWVeN