Pausing and Unpausing and also Menu System

0 favourites
From the Asset Store
ready made menu you can download this one or just follow my tutorial to make it yourself
  • Instead of setting the object timescale to 1, use the 'System: Restore object time scale' action to set it back to the game timescale.

    Explanation: You've got the overall game timescale and then each object can have it's own timescale. You're setting the object's timescale to 1 to get it to show. When you pause the game you set the game timescale to 0 but the object still has it's own timescale of 1 so it keeps running.

  • I understand you completely here ramones. However, when I restore more than one object timescale, the system appears to crash. Nothing happens. I think I might need a completely different approach. Is there anyway to have a fade in and out effect for each frame of an animation?

  • Alright folks. I've solved the elusive pause/unpause problem. Wanna' know how it's done? You guessed it...instance variables for every freakin' object in the program. Yuck. But it works.

    I've put comments on everything in the hud and layout entry sheets to explain how it works as best as I can. Unfortunately, I believe I will have to do this for every layout/object...some serious time consumption coming my way.

    I have a new, yet smaller problem now. If I pause and then unpause in layout 2, the layout repeats before moving onto layout 3.

    (ignore the problem of layout 3 disappearing at the beginning for now, this is probably something easy compared to the other problems)

    Thanks to all who posted something useful, namely Nimtrix and ramones for giving me ideas, and thanks to the manual for explaining instance variables!

    philipcomposer.com/comic/wayofthesaxcapx.capx

  • ok, here's the demo (should just load automatically from the link)

    http://www.philipcomposer.com/comic

    there's still some minor problems like I haven't added the menu button on layout 2, the return to layout from menu isn't perfect, etc. but this is a long way from where it was this morning!

  • I think the instance variables are overkill :) Have a look at this. I just changed 'Event Sheet 1' and disabled the timescale stuff in 'hud'.

    wayofthesax1.capx

  • Confirmed working on all layouts thus far! Thanks ramones, you just saved me hours of work! This way even fixes the layout disappearing at the beginning of layout 3.

    So why does "restore time scale" work a lot better than "set time scale to 1" within the layout, but "set time scale to 1" works in the hud? it seems to me that "set time scale" and "restore time scale" are the same thing because the original time scale was 1 to begin with until I manually set it to 0. Grrr. Could this be a Construct 2 glitch or is it like a ghost in the machine that produces the continuing fade out error if I use "set time scale"?

    Either way, thanks. Hopefully, I won't need anymore help like this for a while until I start implementing my more complicated game-type elements.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think setting an object's time scale gives it it's own time scale value that it uses instead of the game time scale. So if you set an object's TS to 1 then it uses that value from that point onwards. When you pause the game and set the game TS to 0, the object still has it's own TS value of 1, so it continues to fade. Using 'restore object time scale' tells the object to use the game TS again and not it's own seperate TS value. That's the way I see it anyway.

  • Yeah, but I wasn't telling each object to have a TS of 1 until it was supposed to come up. For some reason it was reading ahead and setting the TS to 1 out of order, regardless of whether the system's TS was 0 or not. Confusing! At least it works like it should now.

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