A classic timeless Snake game implemented in TypeScript.
This project is a simple implementation of the classic Snake game using TypeScript. The game features a snake that moves around the game board, eating food to grow longer. The objective is to grow the snake as long as possible without colliding with the walls or itself.
- Classic Snake gameplay.
- Responsive game board.
- Simple controls using arrow keys.
- Collision detection with walls and self.
- Randomly generated food.
To play the game, follow these steps:
-
Clone this repository to your local machine: git clone https://github.com/PatrikZitting/Snake.git
-
Navigate to the project directory: cd snake-main
-
Install the project dependencies: npm install
-
Start the game: npm start
-
Open in browser: Navigate to http://localhost:3000/
Press the "Enter" key to begin playing. Use the arrow keys to control the snake and enjoy the game!
Use the arrow keys (Up, Down, Left, Right) to control the snake's direction. Press the "Enter" key to start the game.
Game score is displayed on top of the game (current score and high score). NOTE: Scores are stored only in-session, so if you refresh the page, the high score is also reset!

