ScratchData LogoScratchData
Back to deck26's profile

Broadcast and wait not waiting

DEdeck26•Created December 24, 2018
Broadcast and wait not waiting
1
0
30 views
View on Scratch

Instructions

Press space when state is 1 and the clones will disappear and the sprite will move even though we might think it would be waiting for the broadcast receiver to finish. The receiver is still running though. Press space when state is 2 and the clones get deleted before the broadcast so it works as we expect - the sprite waits for the broadcast to complete.

Description

This is in reference to https://scratch.mit.edu/discuss/topic/323389/ Looks like clones being deleted can confuse Scratch as to whether a broadcast and wait has completed. Explanation from @TheLogFather - The way you have it at the moment, all clones are sending the same broadcast-and-wait (since they all respond to "when space...") – and they send their broadcasts *after* main sprite since (behind it). Each time broadcast is resent, the receivers get terminated (and restarted). But they get restarted for the *new* broadcast, meaning previous no longer has any scripts to wait for. You can change the behaviour by making clones go to front. Then the sprite is last to send broadcast, so waits...

Project Details

Project ID273658985
CreatedDecember 24, 2018
Last ModifiedAugust 21, 2019
SharedDecember 24, 2018
Visibilityvisible
CommentsAllowed