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

#1 2009-06-23 19:46:14

MasterStrife
Scratcher
Registered: 2009-06-23
Posts: 9

Temporarily disabling a "Forever"

This is an extreme annoyance when i have one "forever" and another one running. Especially when they are switch costume blocks. Perhaps:
[blocks]Interrupt Forever ___ for ___ seconds[/blocks]

Offline

 

#2 2009-06-23 21:51:31

SmartIrishKid
Scratcher
Registered: 2008-07-19
Posts: 1000+

Re: Temporarily disabling a "Forever"

Make a variable called "pauseVar", then:

Code:

forever
| costume script here
| if <pauseVar = 1>
| | wait until <pauseVar = 0>
|

Then have the other script set pauseVar to 1 when you want the forever loop to pause.


Discuss future Scratch RPGs, online games, and more!

Offline

 

#3 2009-06-24 05:10:54

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Temporarily disabling a "Forever"

SmartIrishKid wrote:

Make a variable called "pauseVar", then:

Code:

forever
| costume script here
| if <pauseVar = 1>
| | wait until <pauseVar = 0>
|

Then have the other script set pauseVar to 1 when you want the forever loop to pause.

The same thing can be done with a few less blocks with this:

[blocks]
<forever if><(  <{ pauseVar }> <=> 0 )>

do your costume stuff here...

<end>
[/blocks]


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#4 2009-06-27 19:46:48

MasterStrife
Scratcher
Registered: 2009-06-23
Posts: 9

Re: Temporarily disabling a "Forever"

Thanks!

Offline

 

#5 2009-06-30 09:46:37

pinochio
Scratcher
Registered: 2009-03-19
Posts: 1000+

Re: Temporarily disabling a "Forever"

what about a repeat until...?


Flat Out G

Offline

 

#6 2009-06-30 19:34:16

bhz
Scratcher
Registered: 2008-07-06
Posts: 100+

Re: Temporarily disabling a "Forever"

...huh?

Offline

 

#7 2009-06-30 19:59:16

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: Temporarily disabling a "Forever"

pinochio wrote:

what about a repeat until...?

If you want to do it more than once.

Offline

 

#8 2009-07-07 18:59:43

pinochio
Scratcher
Registered: 2009-03-19
Posts: 1000+

Re: Temporarily disabling a "Forever"

what about a forever repeat until?


Flat Out G

Offline

 

#9 2009-07-09 18:17:18

norberts
Scratcher
Registered: 2009-06-06
Posts: 1000+

Re: Temporarily disabling a "Forever"

OR you could not use a forever block.


Coming soon: Super Hero RPG - Based off the forum game.
http://i712.photobucket.com/albums/ww129/Ultratronbot/SuperHeroRPGbanner2.jpg

Offline

 

Board footer