A simple Snake Game desktop application developed using Java.
Snake Game is a desktop game developed as an academic Java project.
The game allows the player to control a snake using the keyboard, collect food, increase the score, and continue growing while avoiding collisions with the game boundaries and the snake's own body.
- Keyboard-controlled snake movement.
- Random food generation.
- Score tracking.
- Snake growth when food is collected.
- Collision detection.
- Game Over state.
- Graphical desktop interface.
- Restart functionality.
- Java
- Java Swing
- Java AWT
SnakeGame/
│
├── src/
│ ├── SnakeGame.java
│ ├── GameFrame.java
│ └── GamePanel.java
│
├── .gitignore
└── README.md
SnakeGame.java
The entry point of the application. It starts the game by creating the GameFrame.
GameFrame.java
Responsible for creating and configuring the main game window.
GamePanel.java
Contains the main game logic, rendering, movement, food generation, score handling, keyboard controls, and collision detection.
- Clone the repository.
- Open the project in Eclipse or another Java IDE.
- Run
SnakeGame.java. - Use the arrow keys to control the snake.
Nada Baker Aljohani
Digital College of Technology for Girls (TVTC) – Jeddah
Web Developer - Graduation Year: 2026
