How do I make the layout restart when the layout is exited

  • So basically i am creating a level in which you click the continue button when time runs out and depending on if you unlocked the next level you may need to re do the same level however when i go on the level again all my variables are the same as my last play and the end screen is still showing, i was wondering how i could create a system that would check for when the layout is exited or even entered and then it uses the system.restartlayout,

    Thanks

  • Use a variable to track the state. If they exit set a variable to 1 or whatever value you want. On the continue button click event check the variable and then you can choose to restart the layout or go to the next one based on that value.

  • Thank you so much

  • Use a variable to track the state. If they exit set a variable to 1 or whatever value you want. On the continue button click event check the variable and then you can choose to restart the layout or go to the next one based on that value.

    Ok so a little update here, I have set it up that way but now when i join the main events that make the game a game don't run

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I haven't fixed it but i have come up with a new way of doing it, if anyone can tell me how to delete posts i would be grateful

  • On exiting set the variables back to the values you had at the start.

  • As TheDom said, if you reset the values of the variables in your goTo layout event you should be fine. For example:

    If Done = 1

    Set Done = 0

    GotoLayout = WhateverLayout

  • TheEggMaster Go to any of your posts and you should see a little pencil icon in the upper right corner. That lets you edit the post. You can delete your last post, not sure about deleting previous posts though.

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