The goal of this project is to create a snake game
Accaptance Criteria
- the snake will be able to move in all directions
- the snake will be able to eat food
- the snake will grow by size 1 when it eats food
- the snake will die if it hits the wall or itself
- the snake will be able to move faster as it grows
- by default snake will move in direction of right every 200ms
- and will be able to change direction by pressing arrow keys
- upon eating food, the snake will grow by 1 and the food will be repositioned
- also speed of the snake will increase by 10ms i.e 200-10=190ms and so on with lowest being 10ms
Game Mechanics
- the game area will be 600px x 600px which will have class
game-area
and position relative - the snake will be made of 2 divs with class
snake-dot
and position absolute with heigth and width set to 2%(parent containergame-area
) - the food will be made of 1 div with class
food-dot
and position absolute with heigth and width set to 2%(parent containergame-area
) - So when snake's length is to be increase we just add one more div with class
snake-dot
When game is over show alert using window.alert()
with message Game Over. Snake length is ${this.state.snakeDots.length}