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

#1 2013-04-11 04:52:38

BarryBurk
New Scratcher
Registered: 2013-04-10
Posts: 4

Stop all does not stop at once

Hi,
I'm having trouble with the "Stop all" control. I would expect it to instantly stop all scripts from running. But I'm experiencing that, for example, it allows a forever-loop to complete its current iteration before it stops.

In the first block below, the sprite will move up until it touches the top edge. However, just after it stops (after a short delay), it makes one more move. To me it seems like it completes the current "forever" iteration, before it finally stops.

In the second block, I've used an "if-else" instead of only "if". This makes the sprite stop instantly when touching the edge, as expected. This is because the "change y by 5" is not run within the same iteration (because it depends of the "else" condition), I suppose.

Is this "correct behaviour", or is it something I oversee in the first example?

when gf clicked
forever  
if <touching [edge v]?> 
stop all 
end
change y by (5)
end
when gf clicked
forever  
if <touching [edge v]?>
stop all 
else
change y by (5)
end
end

Offline

 

#2 2013-04-11 19:21:49

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Stop all does not stop at once

BarryBurk wrote:

Hi,
I'm having trouble with the "Stop all" control. I would expect it to instantly stop all scripts from running. But I'm experiencing that, for example, it allows a forever-loop to complete its current iteration before it stops.

In the first block below, the sprite will move up until it touches the top edge. However, just after it stops (after a short delay), it makes one more move. To me it seems like it completes the current "forever" iteration, before it finally stops.

In the second block, I've used an "if-else" instead of only "if". This makes the sprite stop instantly when touching the edge, as expected. This is because the "change y by 5" is not run within the same iteration (because it depends of the "else" condition), I suppose.

Is this "correct behaviour", or is it something I oversee in the first example?

when gf clicked
forever  
if <touching [edge v]?> 
stop all 
end
change y by (5)
when gf clicked
forever  
if <touching [edge v]?>
stop all 
else
change y by (5)
end

Hmmm... strange. I would've expected otherwise...

Anyway, out of curiosity, do you have any other scripts in your sprite?

With regards,

ErnieParke

Last edited by ErnieParke (2013-04-11 20:52:56)


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2013-04-11 19:41:10

Hyperbola
Scratcher
Registered: 2013-03-15
Posts: 100+

Re: Stop all does not stop at once

ErnieParke wrote:

Hmmm... strange. I would've expected otherwise...

Anyway, out of curiosity, do you have any other scripts in your sprite?

With regards,

ErnieParke

Nope, it happens for me too. I think it's a bug.


Tip of the whatever: Don't post in threads older than 2 weeks unless your post will actually be useful.
It's the last day of 1.4! *cries* (quote from NeilWest, rest by me) by the time you read this it probably will be 2.0  sad

Offline

 

#4 2013-04-11 20:57:20

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Stop all does not stop at once

Hyperbola wrote:

ErnieParke wrote:

Hmmm... strange. I would've expected otherwise...

Anyway, out of curiosity, do you have any other scripts in your sprite?

With regards,

ErnieParke

Nope, it happens for me too. I think it's a bug.

I actually just tested this and I got the same results as you. Well, now that I think of it, it doesn't seem too out of place, though it's a "bug" none the less.

To BarryBurk:
This isn't anything that you're overseeing, though it's not necessarily "correct behavior" either. I'd love to do some more testing on this to find out Scratch's response to issues like this before I can get you more information.

Okay, so I had just conducted some tests. I still haven't found out much, though I did notice that you could always change your upper script into this to remove the "glitch":

when gf clicked
forever
 change y by (5)
 if (touching [edge v]?)
  stop all 
 end

With regards,

ErnieParke

Last edited by ErnieParke (2013-04-11 21:02:39)


http://i46.tinypic.com/35ismmc.png

Offline

 

#5 2013-04-11 21:13:41

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Stop all does not stop at once

I just figured a bit more about the [Stop All] block. Apparently, it doesn't stop everything but actually does it when it runs into a delay of some sort, which in your case, is the end of the forever loop. I'm not sure how this would connect with several other scripts, though at least we know a bit more.  wink

With regards,

ErnieParke


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer