dimanche 24 juillet 2016

Download new variable values javascript

Currently I am saving variables as such localStorage.setItem("variableAchieved",variable.achieved);

then when the user loads the game it loads as such

var variable_save = localStorage.getItem("variableAchieved"); variable.achieved = parseInt(variable_save);

Now this works fine but it requires me to have a first launch for my game that looks like this

variable.achieved = 0

this way the variables are set to 0 on the first launch of the game instead of NaN

Now the issue I am running into is I have a couple hundred users playing my game now I cant reset all thier data when adding new values so how do I force the people who already play the game and the new users to get the new variables with the least amount of coding possible as the majority of my scripts are 8000+ lines

Aucun commentaire:

Enregistrer un commentaire