Skip to content

Latest commit

 

History

History
63 lines (39 loc) · 1.65 KB

README.md

File metadata and controls

63 lines (39 loc) · 1.65 KB

Snake Game in React

This repository contains a simple implementation of the classic Snake game using React. The game allows players to control a snake that grows longer as it consumes apples. The goal is to keep the game going as long as apples are available without colliding with the boundaries of the game board or the snake itself.

Getting Started

To run the game on your local machine, follow these steps:

Prerequisites

  • Node.js: Make sure you have Node.js installed on your system.

Installation

  1. Clone the repository to your local machine:
git clone https://github.com/your-username/snake-game.git
  1. Navigate to the project directory:
cd snake-game
  1. Install the required dependencies:
npm install

Start the development server:

npm run dev

The Snake game should now be accessible in your web browser at http://localhost:3000.

How to Play

  1. Use the arrow keys on your keyboard to control the snake.
  2. The snake will move in the direction of the pressed arrow key.
  3. Try to eat as many apples as possible to make the snake grow longer.
  4. Avoid colliding with the game board's boundaries or the snake itself.

Game Controls

  1. Up Arrow: Move the snake up.
  2. Down Arrow: Move the snake down.
  3. Left Arrow: Move the snake left.
  4. Right Arrow: Move the snake right.

Contributing

If you want to contribute to this project, feel free to fork the repository and submit pull requests. Contributions, bug reports, and feature requests are welcome!

License

This Snake game project is licensed under the MIT License. See the LICENSE file for details.

Have fun playing the Snake game!