How do i move a very large amount of clones at the same time?

so i have like 1-1.5k clones that all need to be moved at the same time at a reasonable speed. i tried using forever loops but those were too slow so now im using broadcasts and they're kinda fast but not super fast.


until the snap! devs use webworkers, that cannot happen.
every single script gets processed one at a time.

the more active scripts the slower snap gets.

What are you even doing with 1.5k clones anyway?

You can nest them. When you make a clone tell it to
untitled script pic
(You don't make a variable called "my anchor"; there's a "my" submenu in the SET block.) Then don't move the clones, only the parent. That should help.

Show only the objects that are currently visible on the screen. Or store the "map" as a list(array) and stamp the block when needed.

bh's advice is nice,and I want to add a small point:broadcast hats go to all clones

couldn't you use few clones with big costumes instead?
stamp all the blocks and then grab the pen trails
use CUT FROM to remove blocks

well yeah i knew that, i was broadcasting to all the clones to move a certain amount. imma try bh's advice tho.


alright it sped it up by a bit

The real problem:Snap isn't designed for computationally intensitive stuff.
I always use stamps instead of clones to make them faster.

Snap! threads aren't designed for etc. Put your computation in a WARP in a single thread and we don't do that badly.

from my experience computation is perfectly fine, but stamps are often too slow
even just 50 or so stamps can be too much and it's not hard to reach that with certain kinds of projects

costume manipulation is also very slow and snap often doesn't have ways to work around it, for example you can't stretch or skew sprites

Oh right.

Yes,but stamps don't resize costumes(ps:none of my recent projects have any costumes)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.