How do I reset every x seconds when the layout start

0 favourites
  • 10 posts
From the Asset Store
Like tourists, Travel around the world as fast as you can!
  • Hi, Every X seconds keep running after i change to other layouts and when I come back to that layout it is a mess. How could I make every X seconds start only when I start the layout?

  • That's weird, it should always reset after every start of the event sheet.

    I think sharing a screenshot would be effective so we can get a better idea of what the problem is.

  • Here is the screenshot of the every x seconds event.

    Btw I'm really new to Construct 2 so I think it might be some trivial things that I forget

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Haha no worries squaresmile, we've all been there....actually I might still be there!

    Hmm...that's weird, it looks ok to me. Just want to check, but when you go to other layouts, do those layouts use the same variables and do they change the variables? If yes, than without resetting all the variables, they will carry the values forward. Try adding a reset global variables on the start of layout and see if it fixes your problem.

    Just a humble opinion, it might be a good idea to use a variable to start your game. For example, varS. On start of layout, wait 1 second than set varS to 1. Than for all the other events, put them as a sub event to the event if varS = 1. You have more control over it and allows you much more leeway later if you want to make changes to when the game should start. Doing this should also resolve your problem if you are still facing it.

  • Am I doing it right because it doesn't resolve my problems.

    My other layout is only a start layout with a start button and high score and doesn't use any variable.

  • Ok that's weird. So even with these, each time you go to another layout, and than return, everything is messed up still? I see you are using two event sheets so the game events sheet should reset each time you enter the game layout.

    If you are willing to share your capx, I will quickly take a look and see what I can do. If not, I will try to recreate this, but might take some time.

  • This is my game Thanks for taking a look. I want every time I play like the first time which is the ball coming out slowly.

  • I am really sorry, I really can't seem to understand why we are getting some different results for the timing each time we restart. I will try taking a few cracks at it again to better understand. I think it must be something simple that I am missing.

    In case you are in a hurry and it takes longer than I expected, I did edit your capx, and created a manual trigger. It has more lines of events though, but the game now works how you want it to.

    https://www.dropbox.com/s/czmgik4fhl8i82j/my%20gameEdited.capx?dl=0

  • Many thanks for fixing it for me. I'm fine with it now. You don't need to work more with my mess

  • Haha ok, good luck on your game.

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