LiveWeb
Pong
The 1972 arcade classic in about 280 lines of plain JavaScript
A browser version of Pong you can play right now, on a laptop or a phone. You're the left paddle, the computer is the right one, and two counters keep score: green for every return, red for every miss. No framework, no build step, just HTML5 Canvas and vanilla JavaScript.
pong-game.app
Pong
Pong
The 1972 arcade classic in about 280 lines of plain JavaScript
- Status
- Live
- Platform
- Web
- Stack
- 4 technologies
- Source
- Open source
Why I built it
I wanted to see how much it takes to make a tiny game actually feel good. Pong looks simple, but the fun comes down to small details: how fast the opponent reacts, how the game scales to any screen, and how smooth the motion is.
My role
Sole developer.
How it fits together
4 layers
- 01Canvas game loop (requestAnimationFrame)
- 02Ball physics and collisions
- 03Eased computer paddle
- 04Mouse, keyboard and touch input
Key features
- Play with the mouse, arrow keys or touch
- A computer opponent that's quick but beatable
- Court resizes to any screen and keeps its shape
- Speeds scale with the screen, so a phone plays like a desktop
- Live hit and miss counters
Built with
- JavaScript
- HTML5 Canvas
- CSS
- GitHub Pages