Skip to content

Arthur12137/SnakeGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Snake Game

A classic Snake game implemented in Java with Swing for GUI.

Overview

The game consists of a snake that moves around the screen, controlled by the arrow keys. The objective is to consume the apples while avoiding collisions with the screen borders and itself.

Features

  • Classic snake mechanics.
  • Randomly placed apples for the snake to consume.
  • Increasing snake size upon consuming an apple.
  • Colorful snake body.
  • Game Over screen when the snake collides.

Files and Descriptions

  1. SnakeGame.java: Contains the main method to start the game.
  2. GamePanel.java: This is the core of the game. It handles the game mechanics, graphics rendering, snake movements, and user input.
  3. GameFrame.java: Sets up the game window using JFrame. It's responsible for initializing and displaying the game panel.

How to Play

  1. Clone the repository.
  2. Compile and run SnakeGame.java.
  3. Use the arrow keys to move the snake.
  4. Try to eat as many apples as possible and avoid hitting the screen borders or the snake itself.

Future Improvements

  • Implement a scoring system.
  • Add levels with increasing difficulty.
  • Introduce power-ups and obstacles.

Requirements

  • Java Development Kit (JDK) to compile and run.

License

This project is open-sourced under the MIT license.


Feedback and contributions are always welcome!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages