Skip to content

Jagrati1213/snake-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game 🐍

This Snake Game is a classic and entertaining web-based game built using HTML, CSS, and JavaScript. It brings back the nostalgia of the retro Snake Game but with a modern twist. Snake Game

Features

  • Responsive Design: The game is designed to be responsive, ensuring an optimal gaming experience on various devices and screen sizes.

  • Scoring System: Keep track of your score as you grow the snake by eating the food. Challenge yourself to achieve the highest score possible.

  • Game Over Modal: When the game ends, a modal will appear displaying your final score and giving you the option to restart the game.

Tech Stack

  • HTML: The structure of the game is defined using HTML to create the layout and elements.

  • CSS: Styling is applied using CSS to make the game visually appealing and responsive.

  • JavaScript: The game logic is implemented using JavaScript, controlling the movement of the snake, handling collisions, and updating the score.

How to Play

  1. Launch the Game: Open the index.html file in your preferred web browser.

  2. Start Moving: Use the arrow keys (Up, Down, Left, Right) to navigate the snake.

  3. Eat the Food: Guide the snake to eat the randomly appearing food to grow longer.

  4. Avoid Collisions: Be cautious not to collide with the walls or the snake's own body.

  5. Score High: The longer the snake, the higher your score. Challenge yourself to beat your previous high score.

  6. Game Over: The game ends if the snake collides with the walls or itself. A modal will appear with your final score.

  7. Restart: Click the "Restart" button on the modal to play again.

Customization

Feel free to customize the game further by tweaking the CSS styles or adjusting the game logic in the JavaScript file (script.js). Add your own features, themes, or modifications to make it your own!

Acknowledgments

This Snake Game was created as a fun project to explore HTML, CSS, and JavaScript. Special thanks to the open-source community for providing resources and inspiration. and Spaicel thanks to @codeWithHarry 🚀.

Happy Gaming! 🐍🎮

Project Image:

snake front snake back