Computer Graphics · 2020

Pong

The classic on a 2D canvas. Play against the computer, against another person on the same keyboard, or watch two bots play each other.

Your browser doesn't support canvas.

Played with a keyboard: open it on a computer.

Modes

  • Player vs NPC you against the computer
  • Player vs Player two people, one keyboard
  • NPC vs NPC two bots; the match starts by itself

Controls

WS
Player 1 (left)
↑↓
Player 2 (right)
Space
Serve

Made with

JavaScript with no libraries on a <canvas>: a loop with requestAnimationFrame, collisions that pick the bounce from the ball's slope, and bots that follow it.