Discuss Scratch

FalconsFury
Scratcher
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/
Crimson19
Scratcher
1000+ posts

Zombies United

Please don't make two topics.
matey1234
Scratcher
1000+ posts

Zombies United

Crimson19 wrote:

Please don't make two topics.
He may have accidentally done it- or maybe it was a glitch in Scratch. sometimes I see double comments
datab
Scratcher
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
ifthen

sitting in a forever loop takes!

Cheers, datab
FalconsFury
Scratcher
100+ posts

Zombies United

Thanks so much datab also thanks for playing

Powered by DjangoBB