A simple Snake game implemented in HTML and JavaScript. Control the snake using the arrow keys and try to eat the red apple to grow. The game resets if the snake collides with itself.
- Canvas-based Rendering: Uses HTML5
<canvas>to render the game graphics. - Snake Movement: Move the snake with arrow keys. The snake wraps around the screen edges.
- Apple Eating: Eat the apple to grow the snake.
- Collision Detection: The game resets if the snake collides with itself.
-
Clone the Repository:
git clone https://github.com/jeetrico/snake_game.git
-
Navigate to the Project Directory:
cd snake_game -
Open
SNAKE_GAME.HTMLin a Web Browser: You can openSNAKE_GAME.HTMLdirectly in a web browser to start playing the game.
- HTML: Defines the structure of the game with a
<canvas>element. - CSS: Styles the page and centers the canvas.
- JavaScript: Contains the game logic, including movement, collision detection, and rendering.
Feel free to fork the repository, make changes, and submit pull requests. Contributions and improvements are welcome!
