How do I create a death counter?

  • Hi guys!

    I'm creating a side scroller. Every time the player dies, a menu pops up, showing the match score and the best score. Then the player can restart the match and play again. In this moment, all global variables are reset to default values.

    How can I add a death counter to the menu that pops up when the player dies?

    Also, I'd like to store this value using LocalStorage, so it doesn't get lost when the game is restarted.

  • By the way, I did something similar with the best score, following a tutorial. I can't get it to work with the death counter, tho.

  • Could you please upload the screenshot of deathCounter Event sheet?

  • the bellow example should give u an idea on how to save/call localstorage and reset update the score then reset the data and global variables. order of events must be as done if u miss placed them you will get weird glitches or data loss.

    as for things popping up when player is dead call some sprite to get on screen and put a text on it... then call the localstorage usually can work with a function by using the function plugin or by simply using a local variable to toggle it or even a group event. you can find a lot of those tables animations etc in tutorial section of Construct 2 and 3 for C2 tutorials u need to go to C2 tutorials all C2 tutorials apply to C3 as well minus the custom plugins or plugins that are out of date on C2. but order of events and logic is the same on C2 and C3.

    i didn't bothered with the popup item cause is very simple to do.

    deathcounter c3 example

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello guys.

    Thanks for the answers. I actually managed to resolve the problem by disabling the "reset global variables to default values", and manually resetting the ones I needed on the start of the layout. Then, I just used the same method I showed on the screenshot.

    gamecorpstudio, I will definitely check out the link you sent anyway. Thanks bro!

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