Back to portfolio Ian Wu

Pong Game (Pygame)

Classic Pong game built with Pygame. Collision detection, score tracking, input handling. OOP structure for maintainability.

This page runs a JavaScript port of the Pygame code, with the same classes and rules, so it plays in your browser. The Python version is in the code.

W/S left paddle · ↑/↓ right paddle · Space serve · P pause. On a phone, drag on your side of the court and tap to serve. First to 7 wins.

How it’s built

Paddle

Moves at a fixed speed and stays inside the court.

Ball

Bounces off walls and paddles, speeding up after each hit.

ComputerPlayer

Tracks the ball with a dead zone, so it can be beaten.

Scoreboard

Counts points and decides the winner.

Game

Handles input, the game states and drawing.