How do you deal with this:
a) I have 3 types of clones : type 1, type 2, type 3
b) type 1 clones must be drawn in the foreground (i call it layer 1),
type 2 clones must be drawn behind (i call it layer 2) and type 3
clones must be drawn in the background (i call it layer 3)
c) The clones are created in a random order during the game,
moreover, the type is random ...
In snap, layer means drawing order: which means that the number of layers is determined by the number of objects (sprites or clones) to draw on the screen (not exactly but...).
So if 3 clones of type 1, 3 clones of type 2 and 3 clones of type3 are present on the screen, if i add another clone of type 3, i can't "go to front layer" and "go back 3 layer" ; i need to "go to front layer" and "go back 6 (or 9) layer"
How do you deal with that in your projects ?
Would it be possible to help me develop a function goto layer at "My layer 3" (where all type 3 clones are located) (not at layer 3 of Snap) (the function: goto layer 3)
edit: Solution:
This is an example of the implementation of the solution... I have made the help for each block.
there is a solution, @davidgasku made a Layers system that allows you to put sprites at a certain layer, and have multiple sprites on one layer. I think it's what you want.