I've recreated the classic snake game we all know and love.
The project is part of The Odin Project's Javascript curriculum. The objective of the exercise is to recreate the classic acrcade game in which a snake object moves around the board eating food. With each piece of food the snake grows longer. The game is lost if the snake touches the edge of the board or gets so big it runs into itself.
- HTML5
- CSS3
- JavaScript
- jQuery
I've used the 'canvas' element to create a drawing platform on which to create the game. This is my first real use of the canvas element.
The CSS styling is based on the legendary Nokia 3310. This was my first ever phone and my first introduction to the snake game. I'm sure the phone still has 10% battery in my drawer somewhere.
The entire gameplay of the snake game has been written in JS/jQuery.
Use the phone's keypad or else the arrow keys on your keyboard to move the snake.
-
Create pop-ups when the game ends displaying score and allowing users to choose if they want to replay or not
-
Increase snake speed slightly with every food eaten.
-
Improve randomization of food location so as to avoid the snake body
-
Add function to the display keypad (up, down, left, right = 2, 8 4, 6)