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

#1 2012-05-21 19:33:17

Leeizazombie
Scratcher
Registered: 2011-09-17
Posts: 53

Any advance scripts for pausiing the game? and to continue?

even if means adding variables to every script


Leegion!! Multiplayer! Construction mode! Play this game and join competitions! http://scratch.mit.edu/projects/Leeizazombie/2759199

Offline

 

#2 2012-05-21 20:50:01

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Any advance scripts for pausiing the game? and to continue?

Check my game Air Raid and go tho the Control sprite and the Pause sprite.


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#3 2012-05-21 21:07:22

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Any advance scripts for pausiing the game? and to continue?

You've really got to go through every script and add an extra conditional (for things like "when key [] pressed", and "when sprite clicked") or a "wait until" block.  To halt loops, just stick "wait until <(pause?) = [false]>" block (beware of loops within loops, as the pause won't take effect until the "wait until" is hit upon, so sticking a "wait until" inside loops that are inside loops can make the pause more immediate.  Any variables with a deliberate delay can be tricky, and I don't think there is a general script for pausing scripts with "wait (1) secs", or those that rely on the timer.

Last edited by MoreGamesNow (2012-05-21 21:07:46)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#4 2012-05-21 23:14:30

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Any advance scripts for pausiing the game? and to continue?

@MoreGamesNow- That's correct, you can't pause blocks like "glide for 1 sec" and "wait 1 sec", or any other time-dependent blocks.  You just have to figure out a workaround (which there always is, though sometimes it's a bit complicated).

Offline

 

#5 2012-05-22 11:18:39

Leeizazombie
Scratcher
Registered: 2011-09-17
Posts: 53

Re: Any advance scripts for pausiing the game? and to continue?

Thanks guys, that helps alot  smile


Leegion!! Multiplayer! Construction mode! Play this game and join competitions! http://scratch.mit.edu/projects/Leeizazombie/2759199

Offline

 

#6 2012-05-22 11:29:40

DHMockingjay
New Scratcher
Registered: 2012-04-12
Posts: 8

Re: Any advance scripts for pausiing the game? and to continue?

Here's my example of a block that will pause a game made, with a

wait (1) sec.
block in it:

Offline

 

#7 2012-05-22 11:41:55

DHMockingjay
New Scratcher
Registered: 2012-04-12
Posts: 8

Re: Any advance scripts for pausiing the game? and to continue?

when gf clicked
repeat until <(timer)  =  [100000000000]>
  go to  [mouse-pointer v]
  wait until <tempo  =  [7]>
end

Offline

 

#8 2012-05-22 11:45:00

DHMockingjay
New Scratcher
Registered: 2012-04-12
Posts: 8

Re: Any advance scripts for pausiing the game? and to continue?

Then, use script


when i receive [pause]
set [tempo] to [7]

Offline

 

#9 2012-05-22 11:48:35

DHMockingjay
New Scratcher
Registered: 2012-04-12
Posts: 8

Re: Any advance scripts for pausiing the game? and to continue?

And, don't forget


when i receive [unpause v]
set [tempo v] to 0

Offline

 

Board footer