You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a Java implementation of the classic Snake game. The game uses the Java Swing framework for the user interface and the game logic is implemented in the GamePanel class.
How to play
The goal of the game is to eat as many apples as possible without colliding with the walls or the snake's body. The snake moves continuously in the direction set by the player. The player can change the direction using the arrow keys. Each time the snake eats an apple, its length increases by one. If the snake collides with the walls or its own body, the game is over.
How to run
To run the game, you need to have Java 8 or higher installed on your machine. Clone this repository and open it in your preferred Java IDE. Then, run the SnakeGame class to start the game.
Background sound
To put a new background sound, drag your desired music to your project file in your java IDE and paste its path in playsound and other methods related to sound playing in GamePanel class.
Dependencies
This game requires Java 8 or higher to run. It has been tested on Windows, Mac, and Linux.
Acknowledgments
This game was inspired by the classic Snake game and is meant for educational purposes only. If you have any feedback or suggestions, please feel free to contact the author.
Team Members
Aman Kumar
Aditya Singh
Kanwaljot Singh
Contributing
If you want to contribute to this project, please feel free to fork this repository and submit a pull request. This game lacks interesting background and your any contribution towards making a good looking background is heartly weelcomed.