Some time ago I worked on a javascript game. One of the major issues I
had to overcome, was that all my data would be gone on a page reload or
when closing and opening the browser. I've been doing javascript for
quite some time now, but I never gave this issue much thought until that
time. After searching for a solution, I came out disappointed.
I
had an object named "game" that contained all the other objects,
players, stars, galaxy and they all cross referenced each other (similar
to any has many and belongs to associations). Ideally, this would be
stored and rebuild on page load.
So I came up with my own implementation, which I'll be open sourcing today:
https://github.com/viseztrance/perseveranceIf you have any issue, feel free to mail me or open a ticket. However you may want to run the jasmine tests first.