is there an easy way to suspend/pause a game and ask "continue Y/N"

i’m trying to implement a ‘go back to main menu’ button/function where the user is prompted “Stop Game Y/N” 

(or "Continue Y/N) without having to code to halt all listeners/physics/and whatever is running in the game.

i know about physics:pause() and that’s easy enough but is there such thing to prevent other timers and listeners to fire up ?

thanks !

Edualc

Look at _pause module from fellow Corona SDK developer @jstrahan

http://forums.coronalabs.com/topic/46668-systempause-systemresume-now-available/?hl=_pause

I’m sure it will do what you need. All the best.

thanks. the demo looks awesome !

but after paying & downloading it it, implementing the few steps required(as per their website) it crashes in my program :( 

granted, i have a stack of performWithDelay running at anyone time, not sure if its the problem

Runtime error

c:\aaa-corona\aaa-game_pause.lua:153: attempt to index local ‘new’ (a nil value)

stack traceback:

        c:\aaa-corona\aaa-game_pause.lua:153: in function ‘performWithDelay’

        c:\aaa-corona\aaa-game\scene1.lua:1496: in function <c:\aaa-corona\aaa-game\scene1.lua:1458>

        ?: in function <?:218>

i did actually made it work. had to replace the first statement with the second one.

– crashtimer = timer.performWithDelay(50, player_jump(ip), 1)                <<— crash !!

  crashtimer = timer.performWithDelay(50, function() player_jump(ip) end, 1)  <<— no crash :slight_smile:

 

otherwise without even trying to stop the game it would crash all over as soon as

reaching this statement.

 

voila.

Look at _pause module from fellow Corona SDK developer @jstrahan

http://forums.coronalabs.com/topic/46668-systempause-systemresume-now-available/?hl=_pause

I’m sure it will do what you need. All the best.

thanks. the demo looks awesome !

but after paying & downloading it it, implementing the few steps required(as per their website) it crashes in my program :( 

granted, i have a stack of performWithDelay running at anyone time, not sure if its the problem

Runtime error

c:\aaa-corona\aaa-game_pause.lua:153: attempt to index local ‘new’ (a nil value)

stack traceback:

        c:\aaa-corona\aaa-game_pause.lua:153: in function ‘performWithDelay’

        c:\aaa-corona\aaa-game\scene1.lua:1496: in function <c:\aaa-corona\aaa-game\scene1.lua:1458>

        ?: in function <?:218>

i did actually made it work. had to replace the first statement with the second one.

– crashtimer = timer.performWithDelay(50, player_jump(ip), 1)                <<— crash !!

  crashtimer = timer.performWithDelay(50, function() player_jump(ip) end, 1)  <<— no crash :slight_smile:

 

otherwise without even trying to stop the game it would crash all over as soon as

reaching this statement.

 

voila.