Skip to content

AliDeli80/Snake-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Project Title

JavaScript Snake Game


Description

A classic snake game built with JavaScript, HTML, and CSS.

Preview

https://htmlpreview.github.io/?https://github.com/AliDeli80/Snake-Game/blob/master/html/index.html

Getting Started

Clone the Repository:

git clone https://github.com/AliDeli80/Snake-Game.git

How to Play

  • Move the Snake: Use the arrow keys to control the snake's direction.
  • Eat the Food: The snake grows longer each time it eats the food.
  • Avoid the Walls and Yourself: If the snake hits a wall or itself, the game ends.

How It Works

  1. Game Board: The game board is created using HTML elements and styled with CSS.
  2. Snake and Food: The snake and food are represented by HTML elements.
  3. Game Logic: JavaScript handles the game logic, including snake movement, food generation, collision detection, and scorekeeping.
  4. Game Over: When the snake collides with a wall or itself, the game ends, and a game over message is displayed.

Feature

  • Classic Gameplay: Navigate the snake to eat food and grow longer.
  • Game Over: The game ends when the snake collides with itself or a wall.
  • Scorekeeping: Track your high score and improve your skills.

Customization

  • Game Speed: Adjust the game speed by modifying the setInterval() function.
  • Board Size: Change the dimensions of the game board by modifying the CSS.
  • Snake and Food Appearance: Customize the appearance of the snake and food using CSS.
  • Sound Effects: Add sound effects for eating food, colliding with obstacles, and game over.

Contributing

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes.
  4. Commit your changes with clear commit messages.
  5. Push your branch to your forked repository.
  6. Create a pull request to the main repository.  

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published