Discuss Scratch

FinnTheCodingKing
New Scratcher
3 posts

Game Stops when a certain message is broadcasted

Whenever the messages LVL! is broadcasted on my game, instead of going to the level, the game just stops. Any tips?

https://scratch.mit.edu/projects/643314777/editor/

theres the link to my game.
CoolBoy4286
Scratcher
100+ posts

Game Stops when a certain message is broadcasted

FinnTheCodingKing wrote:

(#1)
Whenever the messages LVL! is broadcasted on my game, instead of going to the level, the game just stops. Any tips?

https://scratch.mit.edu/projects/643314777/editor

theres the link to my game.
You need to put a forever loop around the script.

Last edited by CoolBoy4286 (Feb. 13, 2022 13:27:47)

deck26
Scratcher
1000+ posts

Game Stops when a certain message is broadcasted

You set DeleteAllClones to 1 so all clones in the project are deleted but thsoe are the only scripts running so the project stops.

Rather than foever loops checking the value of the variable it would be much better to just broadcast when you want clones to delete themselves. Those forever loops are needlessly checking the variable 30 times a second and every clone is running the script.
FinnTheCodingKing
New Scratcher
3 posts

Game Stops when a certain message is broadcasted

Thanks CoolBoy4286.

deck26, how would I do that?
deck26
Scratcher
1000+ posts

Game Stops when a certain message is broadcasted

FinnTheCodingKing wrote:

Thanks CoolBoy4286.

deck26, how would I do that?
Instead of changing the variable just broadcast ‘delete clones’. Then

when I receive [delete clones v]
delete this clone

Powered by DjangoBB