Discuss Scratch

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
asivi
Scratcher
1000+ posts

how to stop all sprites

stop [all v]
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.

when [right arrow v] key pressed
if <(Project Running) = [true]> then

end
blackswan2428
Scratcher
70 posts

how to stop all sprites

It still moves
Atusiff
Scratcher
100+ posts

how to stop all sprites

when Flag clicked
forever
stop [all]
DaEpikDude
Scratcher
1000+ posts

how to stop all sprites

If you have any of these cap blocks:
when [... v] key pressed

when this sprite clicked

when backdrop switches to [ v]

when [... v] > (10)
Those can still run even after the project is stopped. Hence why “when timer > 0” is an unstoppable script.
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
asqwde
Scratcher
1000+ posts

how to stop all sprites

forever
stop [ v]
end
deck26
Scratcher
1000+ posts

how to stop all sprites

asqwde wrote:

forever
stop [ v]
end
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.

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)
stop [all v]
with a possible timer reset before the stop.
twirll
Scratcher
27 posts

how to stop all sprites

when I receive [stop all]
forever
stop [all]
end

Hope I helped


check out my account twirll

Last edited by twirll (Nov. 9, 2017 16:33:08)

deck26
Scratcher
1000+ posts

how to stop all sprites

twirll wrote:

when I receive [stop all]
forever
stop [all]
end

Hope I helped


check out my account twirll
Doesn't help to stop scripts with the header blocks described though. They will function whether or not the project is running.
Emerald2019
Scratcher
1 post

how to stop all sprites

Do This To stop
stop [ all v]
deck26
Scratcher
1000+ posts

how to stop all sprites

Emerald2019 wrote:

Do This To stop
stop [ all v]
Please don't necropost.
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.

Powered by DjangoBB