How do I cannot reset the global variable ???

  • Hi, i have a problem with the global variables. I have a game that save the scores on hosting web mysql. the scores are saved when i add valua to variable score, but to know the player id where to assign the score, i pick the global variable IDPlayer when her is logged.

    To respawn the game whe the player lose, i reset all global variables, but also reset idplayer and then cannot to save the followings scores.

    How can i to asign the id player as other way?, or not reset this variable?

    In other words, how can i reset all variables except one?

    Thanks

  • i guess you could save the variable to local storage?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • try instead o resetting all variables to 0 using a dictionary? and clear dictionary but keep the userid outside the dictionary in a global variable? that way u only need to clear dictionary .. or same as dictionary u can use arrays ... if that is to complicated you can always set the variables u need to reset to initial value manually by setting the actions for each of them when player lose like this : variable 1 set value to 0 etc that way you have bigger control on what u reset and easy to understand...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)