Pong
The classic two-player Pong. Face the computer or share one screen, and reach 7 points first as the ball speeds up.
FAQ
How do I play on a phone?
Does the computer go easy?
Why does the ball keep getting faster?
Are scores saved?
How to use
- Pick an opponent
Computer mode is the default, with the right paddle driven by code. Switch to Two players for a shared screen and one keyboard, or one half of a phone each.
- Serve
Press Space or Start and the ball leaves the centre in a random direction. After a point it serves again automatically.
- Move the paddles
Left paddle uses W and S, right uses the arrow keys. On a phone, hold and drag on either half and the paddle follows your finger.
- Race to 7
Each point counts once and the first side to 7 wins. Press Restart to clear the score and play again.
About this tool
Pong arrived as an Atari arcade game in 1972 and became one of the first video games most people ever saw. The rules fit in a sentence: the ball bounces, a paddle blocks it, a miss scores a point. What keeps people playing is speed. Longer rallies make the ball faster and the reaction window shorter, so most points end on a single twitch. In arcades two people crowded one cabinet while the loser stepped aside, and that rotation kept another coin dropping.
The page separates physics from rendering. Ball position, velocity and score are plain data; each frame advances that data by the elapsed time and runs collision checks, while the canvas only draws the result. Tests can advance time by hand instead of waiting for real frames. Where the ball meets the paddle changes the bounce angle, wide near the edges and flat in the middle, which matches the arcade feel.
How it works
Pong physics needs two rules. Hitting the top or bottom wall flips vertical velocity, and hitting a paddle flips horizontal velocity while adding an angle based on the contact point. Speed multiplies by a factor slightly above one on every hit, with a cap so the ball never outruns what the display can show. Collision checks subdivide each frame into small steps, because a fast ball can otherwise pass straight through a paddle, a common bug in homemade versions.
The computer opponent gets its difficulty from parameters, not cheating: top speed, a dead zone and reaction delay. Too slow and it misses everything, too fast and it becomes unbeatable. Setting its cap just under the ball maximum means long rallies eventually beat it. Two-player games reward anticipation and rhythm instead. Once you are comfortable against the computer, a human opponent usually turns out to be better at creating angles.
When to use it
- A lunch break duel
Two people share one keyboard for a best-of-three at lunch. No tutorial is needed and a round lasts two or three minutes, which fits a break. The loser hands over the keyboard, so several people rotate in, and it starts more conversations than scrolling a phone.
- Playing with a child
Pong only asks for up and down, so a young player can join immediately. Computer mode gives quick wins and losses, which makes it a good first two-player game. A parent can call out the landing point from the side while the child builds a sense of where the ball will go.
- Testing a keyboard
A new keyboard arrives and you want to feel key response and rollover. Holding W and S on the left while tapping arrows on the right shows the layout and rebound faster than typing a paragraph. One match is usually enough to reveal which keys feel awkward.
Tips & tricks
- Hit with the edge of the paddle to send a sharper angle and make the return harder to read.
- Do not chase the ball. Move the paddle to the predicted landing point early and fine-tune as it arrives.
- In two-player mode, agree on who serves and when to swap sides before the first point. It saves arguments later.
Things to watch
- Holding a direction key
The paddle parks against the wall and the ball sails past on the other side. Move to the predicted landing point early and adjust near the end instead of chasing. New players make this mistake most, and a few rounds usually fix it.
- Two players fighting the controls
On a shared keyboard, keep arrows and W / S separate and avoid pressing the other player keys. On a phone, each person stays on their own half, or one finger will drag the other paddle away. Agree on sides before the first serve and the match runs smoother.
- Panicking as the ball speeds up
Fast rallies invite frantic movement. Parking the paddle in front of the ball and letting it come to you works far better than chasing it across the court. Breathe, read the direction, then move. A slower rhythm usually wins more points than raw speed.