A simple Snake game built with JavaScript, HTML, and CSS.
This repository contains the source code for a classic Snake game implemented in JavaScript. The game is designed to be lightweight, responsive, and customizable, making it a great project for learning or showcasing JavaScript programming skills. Players control a snake that grows in size by eating food while avoiding collisions with walls or itself.
- Classic Snake gameplay.
- Responsive design for desktop and mobile.
- Pause Button: Pause the game at any time and resume later.
- Replay Button: Restart the game instantly to play again.
- Fruit Consumption: The snake grows by consuming fruits.
- Score Display: The total score is displayed during gameplay.
- Fruit Counter: Tracks and displays the number of fruits consumed by type.
- Random positioning of fruit
- Background music: There's a background song when the serpet swallows a piece of fruit
- A modern web browser .
- Git (to clone the repository).
-
Clone the repository:
git clone https://github.com/Lane-Romuald/Snake-Game-JavaScript.git
-
Navigate to the project directory:
cd snake-game
-
Open
game.html
in your browser (preferably Google Chrome, Mozilla Firefox) to play the game.
- Use the arrow keys (or swipe on mobile) to control the snake.
- Avoid colliding with the walls or yourself.
- Eat the fruits to grow the snake and increase your score.
.
├── index.html # Main HTML file
├── css/ # Styles files folder
├── js/ # Game logic file folder
├── assets/ # Game assets (images, sounds, etc.)
├── LICENCE # Licence of Projet
└── README.md # Project documentation
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
. - Commit your changes:
git commit -m 'Add some feature'
. - Push to the branch:
git push origin feature-name
. - Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Inspired by the classic Snake game.
- Special thanks to all contributors and the JavaScript developer community.
For questions or feedback, feel free to contact me:
- Email: r6lane@gmail.com
- GitHub: Lane-Romuald