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

#1 2010-10-29 19:09:04

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

how to stop and avoid stopping a script

I completed the list or projects that take advantage of the "code reentrancy" feature of Scratch. Code reentrancy means that a script immediately restart even when the script didn't complete its previous run. This happens for all script when the starting condition (the hat) happens again: green flag clicked, key pressed, mouse clicked, message received.

In the first project (http://scratch.mit.edu/projects/s_federici/1381338) and in the second project (http://scratch.mit.edu/projects/s_federici/1383090) we allow the Stage or a Sprite (respectively) to immediately stop the script of another sprite.

In the third project (http://scratch.mit.edu/projects/s_federici/1383177) we want to avoid to stop the script of a given sprite if this is already running. Further requests are simply discarded.

In the fourth project (http://scratch.mit.edu/projects/s_federici/1383298) we want again to avoid to stop the script of a given sprite if this is already running. This time we want to queue pending requests so that we can run them as soon as the Sprite is not busy.

Last edited by s_federici (2010-10-30 10:22:10)

Offline

 

#2 2010-10-30 04:15:17

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: how to stop and avoid stopping a script

wow! this really is some nice projects you have there, Federici!

oh and, happy 300 posts  smile

Offline

 

Board footer