ScratchData LogoScratchData
Back to OriginallySystemized's profile

Kill that lag! (How to...)

OROriginallySystemized•Created April 26, 2017
Kill that lag! (How to...)
0
0
4 views
View on Scratch

Instructions

I've seen this problem a lot, so decided to write a project about it :) Once the demo starts, it creates clones of a ball sprite (up to 300), with each one performing a basic mouse roll-over effect. The bad method shows what happens if you use the way that is very common in Scratch projects: continually set looks within forever loop. But notice how it slows down as more balls are added! SEE INSIDE to find out how to do it much more efficiently... :)

Description

** UPDATE ** with alternative method (called "ok") that's not as bad as the "bad" method - uses variable to avoid setting effects. I hope the comments inside help to explain the difference between the three methods, and why the common method causes lag. Note that it's not specific to lots of clones (they could be lots of different sprites instead) - it's just to do with having so many scripts that are continually setting looks within their own forever loops. Also, the ball costume here is pretty simple and not that large. If you use bigger and/or more complicated costumes, it gets much worse...

Project Details

Project ID157356057
CreatedApril 26, 2017
Last ModifiedApril 26, 2017
SharedApril 26, 2017
Visibilityvisible
CommentsAllowed