Skip to content

LI123456mo/SnakeGame_OOP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 

Repository files navigation

Java OOP Snake Game

A complete rebuild of the classic Snake Game using Object-Oriented Programming (OOP) principles.

πŸ— Architecture (MVC Pattern)

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.

πŸ›  Backend Concepts Applied

  • Encapsulation: Using private fields and public Getters/Setters.
  • Composition: The GameEngine manages instances of Snake and Food.
  • Data Structures: Utilized LinkedList for $O(1)$ time complexity on movement.
  • Event-Driven Programming: Implemented Swing Timer and Key Bindings.

πŸš€ How to Run

  1. Clone the repository.
  2. Open in any Java IDE (IntelliJ, Eclipse, VS Code).
  3. Run the Main.java file.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages