Lifetime death counter

Chr0nosChr0nos Wondering Vagabond AustraliaMember Posts: 113

Hi guys,
I am wanting to add a death counter that counts all the deaths of a player over the lifetime of the game. In other words, I want the app to store every single death the player has ever had, and be able to display this in a scene somewhere. Does anyone know of any good tutorials where this is shown?

Thank you!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2015

    Set up your rules as follows:

    Load attribute game.deaths [key:deaths]
    When [condition for player death]
    .....Change Attribute game.deaths to game.deaths+1
    .....Save attribute game.deaths [key:deaths]

    Use a Display Text behavior to show game.deaths.

    If you still need a tutorial, Google gamesalad high score. It's essentially the same process.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Chr0nosChr0nos Wondering Vagabond AustraliaMember Posts: 113

    You are a legend tatiang, thank you so much!

  • Chr0nosChr0nos Wondering Vagabond AustraliaMember Posts: 113

    @tatiang, that worked beautifully.
    I just have one more question.

    The counter only keeps track of the number of deaths as long as I'm in the preview mode. When I exit the preview, and start it again, the counter is reset to 0. So is it actually saving the deaths forever (eg. can the user exit the app and come back later to find the deaths still counting up) or is it only counting the deaths for that play through?
    Thank you for your help!

  • BigDaveBigDave Member Posts: 2,239

    the previewer doesn't save attributes and timers.

    You have to make an adhoc version to test if it works properly on your device.

  • Chr0nosChr0nos Wondering Vagabond AustraliaMember Posts: 113

    Ahhh I see. Thank you BigDave.
    How do I make an adhoc version? Is that where you upload it to GS?

Sign In or Register to comment.