Tetris (Java Swing)
A Tetris clone built in Java Swing to practice object-oriented game design — piece movement, collision, line clearing, and a live difficulty curve, built from scratch without a game engine.
- Period
- Fall 2025
- Role
- Solo
- Stack
- Java · Java Swing · OOP
- Source
- Repository
The problem
Tetris looks simple and is a reasonable stress test for object-oriented design anyway: falling pieces, collision against a fixed board, line clearing, and a difficulty curve that all have to update live — enough moving, interacting parts that a sloppy class structure turns into a mess fast.
What I built
A Java Swing implementation with the standard Tetris feature set: piece movement, rotation, and collision detection driven by keyboard input; line clearing with score accumulation; a difficulty curve that speeds the game up as score increases; and game-over detection with a restart path.
This was built primarily as a practice project — object-oriented class design and Swing’s rendering/event-loop model — rather than to push any particular technical boundary, and the case study reflects that scope honestly rather than inflating it.
What I’d do next
- Automated tests for collision and line-clear logic, instead of relying on manual play-testing to catch regressions.
- A proper piece bag/randomizer instead of pure random selection, plus a hold slot and next-piece preview.