Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game – Java

A simple Snake Game desktop application developed using Java.


About the Project

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.


Features

  • 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.

Technologies Used

  • Java
  • Java Swing
  • Java AWT

Project Structure

SnakeGame/
│
├── src/
│   ├── SnakeGame.java
│   ├── GameFrame.java
│   └── GamePanel.java
│
├── .gitignore
└── README.md

Main Classes

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.


How to Run

  1. Clone the repository.
  2. Open the project in Eclipse or another Java IDE.
  3. Run SnakeGame.java.
  4. Use the arrow keys to control the snake.

Developer

Nada Baker Aljohani

Digital College of Technology for Girls (TVTC) – Jeddah

Web Developer - Graduation Year: 2026

About

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.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages