I am making a game. When I press p, I want a pause menu to pop up. Now, I have already done that, but when I open the pause menu, I want it to stop all scripts. I cannot use the "Stop All" block because then I am forced to resume all scripts using the green flag, and it can be problematic as many of my sprites have scripts that are not started with the green flag. Is there a way that I can "Resume All?"
Offline
Do this in one sprite:
When gf clicked Broadcast [whatever v] Forever Wait until <key [s] pressed?> Broadcast [pause v] Wait (0.2) seconds Wait until <key [s] pressed?> Broadcast [whatever v] Wait (0.2) secondsThen have this in all the sprites you want stopping:
When I receive [whatever v] Repeat until <key [s] pressed?> Action goes here
Last edited by turkey3 (2012-03-21 18:03:15)
Offline
What I do is have a variable that is called mode and then when you press p or a pause button is clicked then it will set the mode to pause. Then you can have your scripts that you want to stop in a forever loop and only have them run if mode = play.
If you want an example then download my project Project Trinity v.0.2 and look at it.
Last edited by wolfdude999 (2012-03-21 20:01:33)
Offline
Or you could create a variable which is changed by pressing the pause button - then on the sprites in the game, make them wait until the pause variable = unpaused state before continuing with their actions. I think i have used that in one of my games
Offline
i'm also having the same problem.
most of the game i'm creating, (It's a SCRATCH version of "The Sims") never involves pressing keys. just mouse clicking.
When i press pause mode, it stops scripts, but when i click live mode, they don't resume! plus, there would be sounds playing too.
Can you please help me?
Kudos for anyone that can help!
Offline