Welcome to the Snake Game project! 🐍 This is a classic Snake game built using HTML, CSS, and JavaScript. The game features a simple but engaging gameplay where you control a snake to eat food and grow longer. Your objective is to score as high as possible without running into the walls or the snake's own body.
- Classic Snake Gameplay: Control the snake using arrow keys and try to eat the food to grow longer.
- Score Tracking: Your current score is displayed on the screen.
- Game Over Screen: When the game ends, see your final score and have the option to restart.
- Name Input & History: After the game ends, enter your name to save your score. View the last 5 scores along with player names in a table.
- Stylish UI: A clean and modern design with smooth hover effects on the header and footer.
- Start the Game: The game starts automatically. Use the arrow keys (Up, Down, Left, Right) to control the snake's direction.
- Eat the Food: Move the snake towards the red food to increase your score.
- Avoid Collisions: Don't let the snake collide with the walls or itself.
- Game Over: When the game ends, enter your name in the provided text field to save your score.
To play the game locally:
- Clone the Repository:
git clone https://github.com/sharath4444/snake-game.git
- Navigate to the Project Directory:
cd snake-game - Open
index.htmlin Your Browser: Simply double-click theindex.htmlfile or open it in a web browser.
You can play the game live here.
Feel free to fork the repository and submit a pull request if you have suggestions for improvements or new features. Your contributions are always welcome!
If you have any questions or feedback, you can reach me at mankalasharathchandra4@gmail.com.
Enjoy the game and have fun! 🎮