Classic Snake Game written in Vanilla JavaScript with the use of CSS grid. Simple functionality.
This is another from the mini-project series. This was a great learning expereince and good practice of CSS grid. The game is fully functional according to the classic Snake gameplay.
https://nickmezacapa.github.io/JavaScript-Snake-Game--mini-project/
-
I would like to add score keeping functionality as well as session high-score recording.
-
I would like to make the snake movement slightly smoother.
-
I would like for snake movement speed to gradually increase as the body length increases, providing progressive difficulty.
-
Some small styling adjustments to improve UI (unnecessary but will enhance user experience and serve as good practice).
-
For the sake of a mini project, all purposes are served.
PR requests welcomed!
- The user is able to move snake in either right, left, up or down directions.
- When the user runs into a wall, the game is over and they are prompted to restart.
- When the snake head runs into it's body, the game is over and the user is prompted to restart.
- When the user runs into a food piece, the snake's body length increases by one segment.
- The food segments that are added to the snake's body are added in green (snake body color), not yellow (food piece color).
- As the snake moves, each segment follows the segment in front of it. The snake body will not move as one member, but rather "slither".
- The snake is not able to move in the opposite direction and impose over it's own body. There are only 3 possible movement options.