Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Making games less laggy
- K9bella1
-
17 posts
Making games less laggy
Hello everyone from scratch I need some help i made a game its a top down zombie survival shooter and i need some help making it les laggy it barely works and its not fun to play because of the lag so if anyone knows how heres a link to it sorry for the meesy coding
https://scratch.mit.edu/projects/497802074/
https://scratch.mit.edu/projects/497802074/
- AksharPremnath
-
500+ posts
Making games less laggy
I would recommend using as little forever loops as possible by combining them into one loop. In one of my unfinished games, I had lots of forever loops and that worked. If that doesn't work I would recommend including a link to Turbowarp in the Notes and Credits.
- K9bella1
-
17 posts
Making games less laggy
ok thanks ill try the forever loop thing i know i have like 10
- gor-dee
-
1000+ posts
Making games less laggy
Two things…get rid of the touching colour blocks, these are the worst blocks for lag by far. You could make a sprite that is just the yellow area and use touching sprite instead.
Secondly and more important, your clones are making clones of themselves because clones react to broadcasts. Make a local variable (this sprite only) “clone?” and set it to 0 under the green flag and set it to 1 under the ‘when I start as a clone’ then have
Secondly and more important, your clones are making clones of themselves because clones react to broadcasts. Make a local variable (this sprite only) “clone?” and set it to 0 under the green flag and set it to 1 under the ‘when I start as a clone’ then have
- HawkwingX
-
70 posts
Making games less laggy
Maybe you could add a blank sprite? It works for some people
- gor-dee
-
1000+ posts
Making games less laggy
There's nothing wrong with using forever blocks but you want to avoid having scripts running when they don't need to, such as in a hidden sprite. does any one know what i can substitute for
- CodingBaguette
-
500+ posts
Making games less laggy
Something else that can help is making a sprite, name it whatever you want and move the sprite to the top of the sprite list. Then when you open the project you have selected that sprite. This was found by griffpatch. Baisicly, whenever a script runs scratch has to draw a yellow line around it. That creates lag. But if you have a blank sprite selected with no blocks in it, it does not have to draw any yellow lines so that should help. and make a custom block with run without refresh in the forever loop and just run everything in the custom block.
- Discussion Forums
- » Help with Scripts
-
» Making games less laggy