instance variables Reset Before I want

  • Hello family, for some reason the I. V. I have on my player go to zero when the player dies and I need them to stay until I actually restart the game. I'm comparing Items collected during the game to see if the player is getting more or the enemy. It's just for show not trying to save or store I just want to see them both on the screen until I hit try again in which case all the Vars reset and the game starts again.

    Is it possible to keep it from going zero or is that a default of the I.V. being on the player who gets destroyed at the end of the game?

    Thank you in advance for your time...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Usually you would store data like this as a global variable, since it is essentially keeping track of a score. The 0 you see is because you've deleted the player instance and it doesn't exist anymore. If you keep track of the data with a global variable then whatever happens with the player object won't affect the score.

  • Yes I figured that's what I would have to go back and do. I thought maybe there might be a check box I was missing to allow it to stay. I have so many already I was trying to keep the code as clean as possible but I guess a few more GV's won't hurt...

    Thank you very much

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