leopard icon indicating copy to clipboard operation
leopard copied to clipboard

Remove _layerOrder and just store sprites in-order

Open adroitwhiz opened this issue 7 months ago • 2 comments

Depends on #207.

This gets rid of the clones hierarchy and _layerOrder property, and stores every rendered target (sprite, stage, or clone) in one array kept in layer order. Clones now refer directly to the "original" sprite instead of their parent.

While this does require some more management of that array, it means we don't have to:

  • Maintain the _layerOrder property
  • Construct and sort a bunch of new arrays every time we want to loop through all the rendered targets (slow)
  • Traverse upwards through the clone hierarchy to find the "original" sprite

Starting triggers is also done in top-down order now (reverse layer order), which matches how Scratch does it.

adroitwhiz avatar Jul 16 '24 14:07 adroitwhiz