A classic Snake game built using HTML, CSS, and JavaScript. Enjoy the nostalgic game where you control a snake to eat food and grow longer, avoiding collisions with the walls and yourself.
Use the arrow keys to control the snake. The objective is to eat the food that appears on the board. Each time the snake eats the food, it grows longer, and your score increases. Be careful not to run into the walls or yourself, or it's game over!
- Classic Snake game mechanics
- Real-time score tracking
- High score tracking stored in the browser's local storage
- Background music and sound effects for food, movement, and game over events
-
Clone the repository to your local machine:
git clone <repository-url>
-
Navigate to the project directory:
cd SnakeGame
-
Ensure you have a web server to serve the files, such as Live Server for Visual Studio Code.
- Open the project directory in your code editor.
- Serve the
index.html
file using your preferred web server or by opening it directly in your browser. - Use the arrow keys to start the game and control the snake.
index.html
: The main HTML file containing the game structure.style.css
: The CSS file for styling the game.script.js
: The JavaScript file containing the game logic.music/
: Directory containing sound files used in the game.food.wav
: Sound played when the snake eats food.gameover.wav
: Sound played when the game is over.move.mp3
: Sound played when the snake changes direction.game.mp3
: Background music played during the game.