16bitash / Arena-question---React-Snake-Game---25jx66m9y4h6

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

boilerplate-react-functional-public

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 container game-area)
  • the food will be made of 1 div with class food-dot and position absolute with heigth and width set to 2%(parent container game-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}

About


Languages

Language:JavaScript 88.5%Language:CSS 6.7%Language:HTML 4.8%