A complete rebuild of the classic Snake Game using Object-Oriented Programming (OOP) principles.
This project is structured to demonstrate Separation of Concerns:
- Model (
Snake,Food): Manages the data and state. - Controller (
GameEngine): Handles the business logic and rules. - View (
GamePanel): Handles the rendering and user input.
-
Encapsulation: Using
privatefields andpublicGetters/Setters. -
Composition: The
GameEnginemanages instances ofSnakeandFood. -
Data Structures: Utilized
LinkedListfor$O(1)$ time complexity on movement. -
Event-Driven Programming: Implemented Swing
TimerandKey Bindings.
- Clone the repository.
- Open in any Java IDE (IntelliJ, Eclipse, VS Code).
- Run the
Main.javafile.