Kinda struggling, this is what i have so far.
Every Tick
For each Sprite1
Sprite1.Y > Sprite2.Y
> Move Sprite1 to Top of Layer
Every Tick
For each Sprite1
Sprite1.Y < Sprite2.Y
> Move Sprite1 to Bottom of Layer
This is working as intended. However when i add more sprites to the mix it gets a bit loco. Here are some images imgur.com/a/aNh51
I understand what is happening, but I'm not sure of a good approach to get this working.
Thanks in advance for any advice.