O'Rat — a Java 2D game built on design patterns
O'Rat is a three-level 2D puzzle game written in Java (AWT/Swing) — and an exercise in using GoF design patterns for real, not just on a whiteboard.
The game
You guide a lab rat through three levels — Tutorial, Labyrinth, Laboratory — each introducing new mechanics. Game state persists to MariaDB, so progress survives restarts.
The engineering
The point of the project was structure. Three patterns carry the codebase:
Singleton — one game engine, one database connection, one asset manager.
Flyweight — tile sprites shared across the map instead of duplicated per cell, keeping memory flat as levels grow.
Abstract Factory — level construction behind a factory interface, so adding a fourth level means implementing a factory, not touching the engine.
Team
Built with a teammate for the PAOO (OOP) course at TUIASI; credits and the exact split are in the README.