ScratchData LogoScratchData
Back to s_federici's profile

how to immediately stop a script (Scratch 1.4/2.0)

S_s_federici•Created October 29, 2010
how to immediately stop a script (Scratch 1.4/2.0)
2
0
783 views
View on Scratch

Instructions

In Scratch 1.4 there is no "stop other scripts of this sprite" block. And the "stop other scripts of this sprite" block of Scratch 2.0 stops ALL scripts of a sprite. Thanks to Scratch re-entrancy, we can decide if we want to selectively start or stop a script. Scratch re-entrancy is when you send a message: the scripts that where already running because of the very same message, are rerun from start. So we can selectively start or stop a script by simply setting a variable and checking its value every time that that message is received. The goal in this project is to allow any sprite (or the sprite itself) to stop a running script of another sprite. In this example the cat's script is started and stopped by Sprite2, by sending the "start dancing"/"stop dancing" messages.

Description

Animation Technique

Project Details

Project ID1383090
CreatedOctober 29, 2010
Last ModifiedMarch 31, 2022
SharedOctober 29, 2010
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root