Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Zombies United
- FalconsFury
-
100+ posts
Zombies United
I can't figure out how to limit any more lag to my game. It doesn't lag on my laptop but on weaker computers they do. Is there a way to enhance my code so that those computers won't lag? Thanks
http://scratch.mit.edu/projects/51070164/

http://scratch.mit.edu/projects/51070164/
- matey1234
-
1000+ posts
Zombies United
He may have accidentally done it- or maybe it was a glitch in Scratch. sometimes I see double comments Please don't make two topics.
- datab
-
20 posts
Zombies United
Hi FF,
You're right, I lag pretty badly by 12 zombies. Until then it is lots of fun.
I started speeding things up by taking out some If blocks in the zombie clone code… (1) instead of each zombie checking for touching with Sprite 2, 7, 8, 9… just check for touching “black”. (2) instead of zombies always checking for pause, have pause change a “speed” variable to 0.. put that variable in their movement block and they stop.
That seemed to speed things up a bit. Which makes me wonder how much time each
sitting in a forever loop takes!
Cheers, datab
You're right, I lag pretty badly by 12 zombies. Until then it is lots of fun.
I started speeding things up by taking out some If blocks in the zombie clone code… (1) instead of each zombie checking for touching with Sprite 2, 7, 8, 9… just check for touching “black”. (2) instead of zombies always checking for pause, have pause change a “speed” variable to 0.. put that variable in their movement block and they stop.
That seemed to speed things up a bit. Which makes me wonder how much time each
sitting in a forever loop takes!
Cheers, datab
- Discussion Forums
- » Help with Scripts
-
» Zombies United