Okay, so the game has multiple people on screen at once, and I need them to be in front or behind depending on where they are. Naturally, the higher it is on screen, the further back it would be. Lower objects would be towards the front.
It's an isometric perspective sort of like Baldur's Gate or whatnot.
Here is some code I wrote that works when 2 people overlap, but gets confused if 3 people overlap at once. So, it works half of the time.
Basically, I don't want someone higher on screen to end up in front or someone lower on screen to end up behind someone. It breaks the perspective rules.
Surely, there is a better way to do this.
Develop games in your browser. Powerful, performant & highly capable.
There is a better way! You can do it in one event. Put all the objects you want Z-sorted into a family called IsoObject or whatever you prefer and set it up like this:
<img src="https://imagizer.imageshack.us/v2/437x69q90/203/s7uq.jpg" border="0" />
Sweet, that's definitely a lot easier than the way I was doing it. Thanks! :)
mind = blown