Closed getify closed 8 years ago
I created a pull request, see #24 I don't know if its the best solution to store the whole data as a string in a single localstorage item. What do you think?
My next approach: https://github.com/ntwcklng/cloud-sweeper/commit/699c33c54cd7e375afcdcb5c71676edc5e0e1189
I think this is far more better then the previous version.
this looks much better. i'll try to take a closer look soon. :)
The other thing I'd suggest is that there may be other things we want to store/persist than just the score, so maybe there should just be a single data structure that we fill in... like:
settings = {
"build_version": "...",
"best_scores": [ 3, 5, 8 ],
"...": ...
};
In this way, it'll be easier to just add new data to be stored in the future.
Okay, here we go: https://github.com/getify/cloud-sweeper/compare/master...ntwcklng:master It gets better and better, thank you!
Much improved, thanks! There's a few more tweaks I'd like to make to the organization/logic. Would you like to PR this as-is and I can then iterate on it after landing it?
Sure, it's an awesome way to learn! #29
it's an awesome way to learn!
That was exactly my goal. Thanks so much for contributing! :)
probably have it store the game version with the score, and if the game version has a minor or major change (not just patch), have it reset the best scores to 0