Ishadijcks / Ishadijcks.github.io

PokéClicker
15 stars 32 forks source link

Track time played and date started #90

Closed Aegyo closed 7 years ago

Aegyo commented 7 years ago

On loading the page, a new Date() is created and set as dateStarted, and this is replaced if savegame contains dateStarted.

Total time spent playing is updated in save(), lastSaved is updated on load so that time spent with the game closed is not counted.

Ishadijcks commented 7 years ago

So date started is overwitten?

I'd like for it to never be overwritten?

Aegyo commented 7 years ago

It is overwritten from your savegame if it exists there.

If it doesn't then it just uses the date when you loaded the page, every time after it finds that old date in your savegame and uses that instead.

Ishadijcks commented 7 years ago

Woops sorry, didn't read the dateStarted variable!