iiitl / snake-game-js

0 stars 43 forks source link

implemented the score and max score featured #1 #11

Closed rishyym0927 closed 5 months ago

rishyym0927 commented 5 months ago

Screenshot 2024-03-15 021637

Hello @ANKITy102 ,

This pull request #1implemented the score and max score featured #1 aims to enhance the Snake game by implementing a scoring mechanism and persisting the highest score achieved using local storage. The key features introduced are:

  1. Scoring Logic: Implemented a scoring mechanism to track points earned when the snake consumes food. Each time the snake eats food, the score increments, providing feedback to the player on their progress.

  2. Score Display: Added a visual representation of the current score on the game screen, allowing players to monitor their performance during gameplay.

  3. Highest Score Tracking: Introduced functionality to track and display the highest score achieved during the session. The highest score is persistently stored in the browser's local storage, ensuring it remains accessible across game sessions.

  4. Persistence: Utilized local storage to persist the highest score, ensuring that even if the browser is refreshed or closed, the highest score attained by the player is retained.

These enhancements aim to improve the gaming experience by adding a competitive element, motivating players to achieve higher scores and providing a sense of accomplishment.

ANKITy102 commented 5 months ago

@rishyym0927, nice work!