Ping Pong

First to 5 or 11, win by two, against a CPU on three levels. Catch the ball on the edge of your paddle to send it wide, and move as you hit it to add pace.

Setting up the table…

← → or mouse to moveSpace or click to serveP to pause

Your history

Every match you've finished

Loading your matches…

Stored with IndexedDB in this browser only. Nothing is sent to a server, and clearing your site data removes it.

Under the hood

How it's built

  • Three.js draws the table, paddles and ball, with real-time shadows so you can judge the ball's height. Every shot is planned from the spot where it will bounce, which is how it always clears the net.
  • The rules live in their own module and run at a fixed 120 steps a second, apart from the drawing, so the game plays the same on a 60Hz laptop and a 144Hz monitor. I tuned the three CPU levels by simulating thousands of matches against bots of different skill.
  • Finished matches go into IndexedDB in your browser, along with your level and sound settings. No account, no server, and clearing your site data wipes it.