leopard
leopard copied to clipboard
Remove _layerOrder and just store sprites in-order
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.