itaditya / trick-or-treat-game

Play it for free here
https://trick-or-treat.netlify.com/
16 stars 17 forks source link

Add a Scoreboard which stores data in localStorage #16

Closed itaditya closed 4 years ago

itaditya commented 4 years ago

Currently whatever the score user achieves gets lost once they refresh. It would be great if on the left side of the game board we show a scoreboard of scores from least moves at the top to most moves at the bottom.

All the data can be stored in localStorage.

sohammondal commented 4 years ago

@itaditya I want to work on this. A little more information would be helpful.

And also a suggestion, since it's not multiplayer, I think it's better to call it Scoreboard.

itaditya commented 4 years ago

@sohammondal thanks for volunteering to work on this. These are great questions.

  1. Feature branch- soham-add-scoreboard.
  2. I'll draw a mockup of the layout with scoreboard. For the design a list (with numbers) with heading would do (in white color with visual hierarchy).

Something like

Scoreboard

  1. someuser1 - 15
  2. someuser2 - 30
  3. someuser1 - 40
  4. someuser1 - 45

Things to note-

  1. List goes from least moves to highest moves.
  2. Once user finishes a game, beside the score, we'll show an input box where they can enter a username. Then in localstorage the score will be saved along with username.

P.S. I have renamed everything to Scoreboard. You are right, leaderboard doesn't make much sense here.

sohammondal commented 4 years ago

@itaditya Thanks for the answers. However, I raised a PR #23 just a few mins ago, please ignore that. I will make the necessary changes.

itaditya commented 4 years ago

Oops I made a mistake. the order you currently have is totally right. Least moves === Highest score. I'll update the comment

sohammondal commented 4 years ago

Got it. No issue. All features implemented. Please check the PR #24

itaditya commented 4 years ago

Issue fixed by #24