How do I make a death counter keep past save/ load game

0 favourites
  • 6 posts
From the Asset Store
Make a displayed number gradually increase or decrease, making an impression of a real-time counting.
  • I have implemented a save / load game feature in my platform game so that whenever you fall into the lava / get hit by falling lava then you will load back up at the previous checkpoint you just ran through, I have a problem though with my death counter as it i want it to count all of the deaths you acquire throughout the game but it deletes the +1 which gets added whenever you get put back at the checkpoint, i have tried using 'nosave' on the text but that doesnt work and have just completely ran out of ideas. the death counter is a global variable which adds onto text on-screen whenever you 'on-collision' with certain objects making them change your x and y co-ordinates to the previous checkpoint, this also loads the state of which the game was in whenever you ran through that checkpoint and in this case will be 0 deaths but i want it to ignore the death variable and make it +1 onto it over and over how many times you die

    Help would be very much appreciated

  • One suggestion: after loading your checkpoint save, add 1 to your death count(to bring it back to where it was pre-load), then save again.

  • i tried that but it doesnt seem to work you just do that by placing the +1 death after the checkpoint x+y load right

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Putting it after the load action probably wouldn't work, no. The system object has a trigger called "On load complete" which is called when your game finishes loading a previous state -- that's probably what you want, so you can do your increment and save as an action there.

  • ohhh i see :p didnt realize haha, i just tried that it will go up from 0 to 1 deaths but after that it wont go up to 2,3,4 etc when i die repeatidly :S

  • ohh now it works! i added the save after it like you suggested in your first post, just missed it out :p thanks alot for that buddy i really appreciate it, my game is pretty much nearly complete now

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