Simple PAUSE

This forum is currently in read-only mode.
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • Just want to share this to newbies. Once you get the logic behind the following events, it'll help you with more complex toggle in the future:

    It's just a simple PAUSE command when you press ESC:

    <img src="http://i46.tinypic.com/bfp99d.jpg" border="0" />

    You will find the original tutorial on toggling states here:

    scirra.com/tutorials/158/veryvariable-toggle-between-two-states

    Hope this helps alot for non-programmer noobs like me.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thanx a lot!

    that was very needed!

  • Thanks, I didn't know pausing was this simple <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Another method is to start at 1, and change it to Pause * -1 when Esc is pressed. Then you can use 1 for timescale 1, and -1 for timescale 0.

  • Well, you can use pretty much any 2 numbers for variables. If you wanted, you could use 100 and 101.

  • Well, you can use pretty much any 2 numbers for variables. If you wanted, you could use 100 and 101.

    Right, I meant that using 1 and -1 means you can get rid of the event "pause > 1" as you toggle the value in the "Escape" event (set pause = pause * -1). Otherwise it's the same.

  • It's good to find people with brain ;-p ... never think to do this like that but now seems to me so obvious !

    Thanks !!!

  • Oh, that's what you meant Jayjay. It saves up on 1 event, thanks! I also noticed that variables that are not time based (ex: Up Arrow is down>Add one to 'Variable') are not affected by this. Just a heads up to put a condition on those types of variables (ex: Up Arrow is down & 'Pause' is equal to 1>Add one to 'Variable').

  • Gelidaer, you can't use conditions like these:

    ==> Up Arrow is down>Add one to 'Variable'

    If you do your game will react different in every FPS rate, ex. 60 fps will add 60 to the variable every second, 15 fps will add 15 to the variable every second, so alwyas use Timedelta to EVERY thing you do.

    Always test your game in the lowest possible FPS rate, and in unlimited FPS rate.

    And for the pause problem that you mentioned, the best solution is to create a group (i named it Runtime) and add almost every event of your layout on this group, when pause happens disable this group in addition to the timescale reduction.

  • Metal_X, thanks. Didn't know that's how it worked.

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