How do I stop the game from skipping a layout?

0 favourites
  • 5 posts
From the Asset Store
five golem elements Sprites Sheet.Best for enemy or villain game characters.
  • Hi, When I preview my project from Layout 4, the game automatically goes to layout 5; however, when I preview it from the very beginning, Layout 2, the game skips layout 5. Here's my project

    Any help is appreciated. Thanks!


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • in Layout 4, You are using "Time=50 Seconds -> Goto Layout 5"

    Time is a system variable that keeps track of how long your program has been running from the time it started (at the very beginning). So, by the time you get to layout 4, more than 50 seconds has already past so it goes right to layout 5.

    You can make a global variable "StartTime" and set it at the start of the layout so you know how many seconds has past when the layout starts:

    "System - Set StartTime= Time"

    then, when checking Time, check for "Time = StartTime + 50"

  • Thanks! So, I created a global variable and changed eventsheet4 to specify starttime+ 5, etc. I don't know if I created the proper event at the start of the game (in eventsheet1) to see how many seconds have passed (I added an event at the end of eventsheet1).

    Now, when I play from the beginning, it doesn't skip the layout, but it doesn't set the text at certain time intervals that I have set (starttime +5, starttime +8 etc). I'm guessing this is because my event in eventsheet1 is incorrect. Any insight?

    Here's the latest version:

    Thanks so much!

  • a couple minor problems...

    first, your layout 1 would have the same issue if you sit on layout 2 for a minute - listening to the music before pressing Play.

    You need to set StartTime at the beginning of each layout that needs it. the system Time variable starts at zero and automatically increments every second your game is running, regardless of the layout you are on. So, when a new layout starts, you want to set your variable to Time, so you can calculate the correct offset from that to make your text appear.

    You don't want to set StartTime=StartTime + 1 every tick, because every tick happens 60 times a second, so you will very quickly end up with a large value that doesn't help you.

    I fixed eventsheets 1 and 4 to work the way you want.

  • Oh I see! Thank you so much! I can't tell you how helpful this is!!!

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