Chill out and play a classic game of Snake! This is a single-player arcade game where you control a snake that grows longer as it eats food.
- Press the Spacebar to start the game.
- Use the Arrow keys to move the snake around the game board.
- The snake will grow longer each time it eats a piece of food.
- Don't let the snake hit the walls or itself, or it's game over!
Your score is displayed in the top left corner and increases as the snake grows longer. The high score is shown on the right. Try to beat your high score each time you play!
- Clone or download the repository.
- Open the
index.html
file in your web browser. - Press
Spacebar
to start playing!
- HTML
- CSS
- JavaScript
This project is based on the "Beginner JavaScript Project – Snake Game Tutorial" by freeCodeCamp.org on YouTube here. While the core gameplay is similar, I've created my own design including an animated gradient border.
Hope you enjoy :)