How do I make a counter revert to a previous value?

Not favoritedFavorited Favorited 0 favourites
  • 2 posts
From the Asset Store
Make a displayed number gradually increase or decrease, making an impression of a real-time counting.
  • Hey everyone. I'm making a game for one of my classes and I have a points system where you collect things from one layout and they carry on into the next. I figured that part out, but I'm having trouble making the points revert to the level 1 value after the player dies. For example, if the player had 80 points in level 1 and moved on to level 2 and got 20 more points but died, I want the points to go back to 80 (or however many they collected.) Currently, it either goes to 0 or to a negative number. My global variable is set to 0, and 20 gets added each time they collect something. I'm wondering if my code is incorrect.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Shouldn't it be set player score to level 2 starting score? Depends on your game design but from what you described I assume the start of level 2 is the score from level 1. There are many ways to do it. You can store the score at the end of level 1 as a total level 1 score and set your score to this if you die in level 2.

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