Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added leaderboard #18

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open

Added leaderboard #18

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Oct 13, 2016

I've added a leaderboard page.
The high scores are saved in the browser's local storage. I chose local storage because it doesn't get deleted and it has more storage.
I've created a leaderboard object that has an array of the high scores so all the changes to the high scores is made to the array and only then applied to the local storage.
When the game is loaded it checks if there are already high scores and then loads them. it loads the high scores only once and if there's a new high score.
screen shot 2016-10-13 at 13 58 41
screen shot 2016-10-13 at 13 59 36
screen shot 2016-10-13 at 13 58 52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants