I read the post by johnm about concurrency from 2007:
http://scratch.mit.edu/forums/viewtopic.php?id=8130
johnm said: "It [Scratch] runs as many commands as it can until it gets to the end of the innermost loop. If it doesn't hit a loop, Scratch simply runs the rest of the blocks in the stack."
MY QUESTION is if there's a way to force a script (or a portion of a script) to run through without being interrupted? -assuming that it DOES have loops.
So for example, say I have ten sprites, and each one has a script that includes loops. I'd like each script to run through completely before the next script is executed.
I could put each script in a forever loop and have a wait until [it's my turn] at the top. The script whose turn it is would run for a while and then execution would go to the other scripts but would quickly return to the desired one. This doesn't seem ideal.
Or I could put each script under a unique "when I receive" block. Then some other script could "broadcast and wait" each unique message in sequence. But I want all ten scripts to run many times per second - so I'm not sure if the broadcast method is best.
I will test these two options, but I'm hoping there's a trick to force a section of a script (including loops) to run all way through.
Thank you for any help you can give me.
Jeff
Offline
If you have something loop a fixed number of times, you can duplicate the content of the loop the number of times is loops and get rid of the loop completely, but other than that, the only way to do this in Scratch is to run the Scratch project in the flash player with turbo mode.
Offline
Thank you.
(I was afraid of that.)
Offline