iiitl / snake-game-js

0 stars 44 forks source link

Implemented Score and Max Score Feature #1 #76

Closed gauravghodinde closed 4 months ago

gauravghodinde commented 4 months ago

fixes: #1

implementation of the logic of score is as follows

  1. initialize score with zero
  2. if the snake eats food increase the score by 1
  3. after the death of the snake set score = 0

implementation of the logic of max score is as follows

  1. initialize the maxscore with the localStorage if localStorage is null then set it to 0
  2. when the snake dies if the score is greater than the max score then set it to score

video chrome-capture-2024-3-17 (10) (1)