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

#1 2010-10-08 09:33:35

steven_lopez92
New Scratcher
Registered: 2010-10-08
Posts: 1

Scripting Ideas

I think there should be a new "When" Script starter that'll allow you to restart a specified script once it has been completley stopped.

Example:

<when costume # of sprite1 = 20>  --  Script Starter
<forever>
<switch to costume[
<wait(  )secsc>
<switch to costume[
<wait(  )secsc>
<switch to costume[
<wait(  )secsc>
<forever if><key[ a ]pressed?>  -- Have the script ignore this one unless the a key is pressed.
<stop script>
Something like this... or better

And then have it restart itself again if sprite1's costume # = 20

Or

A new script that'll allow you to stop the sub script but keeping the main scirpt, the "When", still running.

Offline

 

#2 2010-10-08 14:59:25

steppenwulf
Scratcher
Registered: 2009-07-23
Posts: 1000+

Re: Scripting Ideas

I'm afraid I don't fully understand how this would work  hmm  Could you create a mockup to show?


I'm graduating HS this April and going to college in the Fall.

Offline

 

#3 2010-10-08 16:26:49

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Scripting Ideas

You can actually do the same thing using broadcasts!

Something like this ought to do the trick:

Code:

When I receive startscript
[INSERT SCRIPT HERE]

When green flag clicked
forever
  if costume # = 20
    broadcast startscript
    wait until <not costume # = 20>
  end if
end forever

So, this really isn't necessary.  smile

Offline

 

Board footer