How do I remember old score and accumulate?

0 favourites
  • 2 posts
From the Asset Store
Dynamic, heavy and powerful rock themes. 11 music tracks.
  • Hi everyone,

    I am currently able to record the score after each game.

    How am I able to update the total score from accumulating the score after every game played?

    Say game 1: 20 points, game 2: 30 points, game 3: 20 points. I should have a variable that accumulates to 70 points. I tried several conditions but it keeps getting reset.

    Thanks,

    Clement

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is your variable being reset in game? or when you restart it?

    Is it resets in game, then you might have a problem in your code that is setting it to it's initial value.

    Create a global variable with the only function to store the sum of all the game's score. In the game of each round add to this variable value the player's score. If it's still resetting try to track down all commands you are setting that are related to this variable, you may have set a condition to reset it that you are not seeing.

    However, if you are have problems keeping the value of the variable stores after you close the game you might wanna consider using a save file with local storage. You can learn how to do that in here: https://www.scirra.com/tutorials/1461/h ... age-plugin

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