Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how to stop all sprites
- blackswan2428
-
Scratcher
70 posts
how to stop all sprites
I've tried everything to stop all sprites but the one that I can control still moves when I put the stop all block
- Scratch-Minion
-
Scratcher
1000+ posts
how to stop all sprites
Keyboard event scripts will run even though your project is not running.
This happens after “stop all”.
To prevent this, add a variable such as Project Running to your project.
Set Project Running to true after the Green Flag.
Set Project Running to false all when you stop your project.
In the Keyboard event scripts, first check if Project Running = true before running the script in them.
This happens after “stop all”.
To prevent this, add a variable such as Project Running to your project.
Set Project Running to true after the Green Flag.
Set Project Running to false all when you stop your project.
In the Keyboard event scripts, first check if Project Running = true before running the script in them.
when [right arrow v] key pressed
if <(Project Running) = [true]> then
end
- DaEpikDude
-
Scratcher
1000+ posts
how to stop all sprites
If you have any of these cap blocks:
The biggest problem is probably “when key pressed”. You can replace all of those blocks with:
when [... v] key pressedThose can still run even after the project is stopped. Hence why “when timer > 0” is an unstoppable script.
when this sprite clicked
when backdrop switches to [ v]
when [... v] > (10)
The biggest problem is probably “when key pressed”. You can replace all of those blocks with:
when gf clicked
forever
if <key [... v] pressed?> then
...
end
end
- deck26
-
Scratcher
1000+ posts
how to stop all sprites
And where would that go? Assuming you mean ‘stop all’ the script doing that would only actually run once. If it was triggered by a key press or whatever it doesn't need a forever loop and once it has stopped the other key press scripts etc would still work.forever
stop [ v]
end
The only way it would work is if the project constantly reset the timer when it was running and you had something like
when (timer) > (0.05)with a possible timer reset before the stop.
stop [all v]
- deck26
-
Scratcher
1000+ posts
how to stop all sprites
Do This To stopPlease don't necropost.stop [ all v]
- Za-Chary
-
Scratcher
1000+ posts
how to stop all sprites
This topic is rather old, so I'll be closing it to prevent further necroposts.
OP, if you need it re-opened, either make a new topic, or report this one and ask for it to be re-opened.
OP, if you need it re-opened, either make a new topic, or report this one and ask for it to be re-opened.
- Discussion Forums
- » Help with Scripts
-
» how to stop all sprites









