How to reset game ?

Add someAdd some Member Posts: 48
edited November 2015 in Tech Support

Hey guys i want make a button on menu and when i click this button all the levels in the game will be reset ?

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Hi @Add some The most effective way to do this is to make all your attributes accessible from a Table.

    Providing you copy a master table with the initial settings to another table for use, when you press your reset button, you can reload the initial settings of your attributes.

    Another way without a Table is if you use Load Attribute and Save Attribute. In your reset button, put a list of Load Attributes with your attributes set to their initial values.

    A bit sketchy but that's it in a nutshell.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • Add someAdd some Member Posts: 48

    Yo bro i use two index ( unlocked level , current level ), what i put in rest button...?

  • SLOCM3ZSLOCM3Z Member Posts: 797
    edited November 2015

    @Add some said:
    Yo bro i use two index ( unlocked level , current level ), what i put in rest button...?

    Change attribute game.Current\game.Unlocked :to: 0. Or do, when button touch is pressed :do: reset game.

  • Add someAdd some Member Posts: 48

    I make two behaviors or two rules in button ( reset ) or what bro ?

  • SLOCM3ZSLOCM3Z Member Posts: 797

    Yes. You would make a rule in the button that says :
    -when touch is pressed
    -:do:
    -reset game.

    OR you could make a rule in the button that says:
    -if touch is pressed
    -:do:
    -change attribute game.CurrentLVL :to: 0
    -change attribute game.Unlocked :to: 0

  • Add someAdd some Member Posts: 48

    Yo bro i choose one of this rules you mean...?

  • SLOCM3ZSLOCM3Z Member Posts: 797

    Yes @Add some. Whichever one you want to use. The first one resets EVERYTHING. The second just changes the scores of those certain attributes.

  • Add someAdd some Member Posts: 48

    Thanks a lot bro

  • SLOCM3ZSLOCM3Z Member Posts: 797
    edited November 2015

    You're welcome! Hope it works out :)

Sign In or Register to comment.