Discuss Scratch

Dankiel_
Scratcher
100+ posts

Extreme Lag

I have made a project on a grid based system, In the “player” sprite, I have some scripts that say when it reaches the edge of the screen, it will go to the opposite end of the screen. I want to make it so that when I teleport to the other side, I load in a new level using a level code.

In the “tiles” sprite there should be a message receiver hat block called “Next Stage” and it should have a code on it, if you run the game then click on the block (not the hat block) you should find that a level generates. this will be the same level everytime.
Now, what I want to do is when the player teleports to the other side of the screen, I will broadcast this block, however it lags everytime. Is there anyone who would know how to fix this issue?

https://scratch.mit.edu/projects/562320994/

Last edited by Dankiel_ (Aug. 25, 2021 00:31:10)

Jareddddddd
Scratcher
1000+ posts

Extreme Lag

hey, not sure how to recreate the bug, theres no lag for me when i run it
Dankiel_
Scratcher
100+ posts

Extreme Lag

Sorry, I should be more clear,

Start the game
then in the “player” sprite
grab a broadcast block
and broadcast “Next Stage”
I find it extremely laggy and slow.
Thingied
Scratcher
1000+ posts

Extreme Lag

Add these things:



(“clone?” is for this sprite only)
The problem is that all the clones are trying to load the level too, causing a lot of lag because scratch is trying to make a ton of clones instantly and the create a clone of () block is pretty laggy. The fix is to just limit the scripts that the broadcast runs to the main sprite.

Powered by DjangoBB