How to pause the game while switch an app.

Hi, I just want to automatically pause the platformer game when the user switch an app. Then, when user switches back, it will count 3 2 1 and then continue. Can I do this on Corona? and how?

Hi @jademwit,

You’ll need to handle this via system events. On “applicationSuspend”, do your pause functionality. Then, on “applicationResume” start the countdown timer… although personally, I would suggest that you give them the option to start the timer via a button or something. In other words, when the app is resumed, let the user decide when they’re ready to continue, since they may not immediately want to launch right back into the game.

Here’s the documentation on system events:

http://docs.coronalabs.com/api/event/system/type.html

Brent

Thank you very much Brent :smiley:

Hi @jademwit,

You’ll need to handle this via system events. On “applicationSuspend”, do your pause functionality. Then, on “applicationResume” start the countdown timer… although personally, I would suggest that you give them the option to start the timer via a button or something. In other words, when the app is resumed, let the user decide when they’re ready to continue, since they may not immediately want to launch right back into the game.

Here’s the documentation on system events:

http://docs.coronalabs.com/api/event/system/type.html

Brent

Thank you very much Brent :smiley: