/snake-game

An implementation of the classic Snake game using HTML5, CSS, and JavaScript.

Primary LanguageJavaScriptMIT LicenseMIT

Snake Game

A simple, yet classic Snake game developed using HTML, CSS, and JavaScript.

Snake Game Logo

⭐️ If you find this project useful, consider giving it a star to show your support. ⭐

About the Project

The Snake Game is a classic arcade game where the player controls a snake that moves around the game area to eat food and grows longer each time it eats. The game gets more challenging as the snake grows, and it must avoid colliding with itself or the walls.

This project implements the basic game mechanics and provides a user interface for an enjoyable gaming experience.

Features

  • Snake movement using arrow keys.
  • A food item that grows the snake upon consumption.
  • Score tracking system.
  • Game over functionality on snake collision with itself or wall.

Getting Started

Follow these instructions to get a copy of the project up and running on your local machine.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Web browser (Chrome, Firefox, Safari, etc.)
  • Git (optional, for cloning the repository)

Installation

No installation is required. Simply clone or download the repository and open the index.html file in a web browser to play the game.

  1. Clone the repository:

    git clone https://github.com/ramazancetinkaya/snake-game.git
  2. Open the project folder:

    cd snake-game
  3. Open the index.html file in your preferred browser.

Usage

To play the Snake Game:

  1. Open the index.html file in your preferred web browser.
  2. Use arrow keys (up, down, left, right) to control the snake.
  3. Collect the red food to grow the snake and earn points.
  4. Avoid collisions with the walls and the snake's own body.
  5. Have fun playing the Snake game!

Game Controls

  • Up Arrow: Move the snake upwards.
  • Down Arrow: Move the snake downwards.
  • Left Arrow: Move the snake to the left.
  • Right Arrow: Move the snake to the right.

Built With

  • HTML5
  • CSS3
  • JavaScript

Contributing

Contributions are welcome! If you'd like to contribute to this project, feel free to fork the repository and submit a pull request with your changes.

If you would like to contribute to the project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature: git checkout -b feature-name.
  3. Commit your changes: git commit -m 'Add some feature'.
  4. Push to the branch: git push origin feature-name.
  5. Submit a pull request.

For major changes, please open an issue first to discuss what you would like to change.

Credits

This project is created by Ramazan Çetinkaya.

License

This project is licensed under the MIT License. For more details, see the LICENSE file.