Share your repls and programming experiences

← Back to all posts
Atari pong
TheForArkLD (204)

i maked atari pong.
You can control from mouse and controller.
And you need WebGL.
please test and share :)

Commentshotnewtop
mwilki7 (938)
  if(starpong){
  ctx.clearRect(0,0,10000,5000) // <-------------------
  ctx.fillStyle='#FFFFFF'
  var posy=e.clientY / (250 / ctx.canvas.height)
  ctx.fillRect(10,posy - 25,10,50)
  bar.x=10
  bar.y=posy - 25
}

The clearRect function call makes the screen flash if you move the paddle. I don't think this line is necessary and it will also stop the flashing.

But nice game nonetheless.