Reset Attribute?

Here's an example scenario, let's say I'm making a platformer, the user has to collect say 10 coins to complete the level and move on to the next. I setup a collected attribute and a remaining attribute, I display them on the screen for the end user.

Now, when we hit a game over/loss scene, we'd reset coins collected to 0 as it'll always be set back to 0, but for remaining coins, it's not a static number so how could I reset it back to it's initial state when the scene resets?

I know I can go into each level and manually set it up to reset the remaining coins to 10 for level 1, 20 for level 2, etc. but looking for a more automated way to go about it than such labor intensive actions when I start having 10, 20, 30 levels etc lol.

Comments

  • contrasthallcontrasthall Member Posts: 131
    you could make a value that gets that value when scene starts up. original coins to get = a, new check coins to get once =b.....now when scene starts a=b if scene reset b=a before the scene ends attribute....is ONE way to do it
  • contrasthallcontrasthall Member Posts: 131
    but if the value is in the scene and not the game it will reset to the original number anyway and thats where i usually place values like that unless i have something in the scene that checks for how many things like that need to be collected
Sign In or Register to comment.