This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-03-17 14:10:03

Lackyman333
New Scratcher
Registered: 2013-03-01
Posts: 9

pause button

ho d i make a pause button?  hmm

Offline

 

#2 2013-03-17 16:00:15

dusty22
Scratcher
Registered: 2012-09-28
Posts: 49

Re: pause button

Well there's no quick way of doing it.

You'd need to make a sprite with Scripts that say when it's clicked, it sends a broadcast to the other sprites or changes a variable that will make them freeze, and then have it do the opposite when it's clicked and the game is already paused.

Offline

 

#3 2013-03-17 17:23:03

Harald
New Scratcher
Registered: 2013-03-05
Posts: 34

Re: pause button

Make a variable called "Pause." Remember to have pause set to "0" when you want to start a new game.

when gf clicked
set [everything to it's original position v]
set [Pause v] to [0]
Then use either a sprite or key to set the pause variable:

when [p v] key pressed
wait [0.05] secs
if <[0] = (Pause)>
set [pause v] to [1]
broadcast [Pause v]
else
set [Pause v] to [0]
broadcast [Go v]
when I receive [Pause v]
stop all
For all your scripts that you want to be paused:

when gf clicked
forever
if <(Pause) = [1]>
Do nothing
else
Do whatever you want to do

Offline

 

Board footer