Hey team! Got what I believe is a bit of an advanced issue with z-order and an isometric-ish perspective.
<img src="http://i.imgur.com/KeSULBoh.png" border="0">
So! In this image there are 11 sprites on-screen. Ten pretty-colored boxes, and one smaller black box. They're aligned based on their Y position. Pretty standard.
<img src="http://i.imgur.com/dJ8Vc1G.png" border="0">
Note: the only other four events are the ones that give the black box movement with WASD.
The issue is that from this perspective, the black box should layer behind or in font of one of the colored boxes based on whether it's on the colored box's left or right side. Case in point:
<img src="http://i.imgur.com/KeSULBoh.png" border="0">
<img src="http://i.imgur.com/4CscM87h.png" border="0">
The bottom boxes have their origin placed at their bottom-back-left corner while the top boxes have their origin placed at their bottom-FRONT-left corner. So, the black box layers fine when to the left of a bottom box, but not to the right. The black box layers fine when to the right of a top box, but not to the left. It's fine when either directly above or below either set of boxes.
<img src="http://i.imgur.com/KeSULBoh.png" border="0">
<img src="http://i.imgur.com/qKadWzBh.png" border="0">
<img src="http://i.imgur.com/AkCD5Vlh.png" border="0">
<img src="http://i.imgur.com/4CscM87h.png" border="0">
You can mess around with the file here.
So! What I need to do is create some events that essentially say the following:
(1) When two objects from the Sprites Family are overlapping, compare the X position of SpriteA to SpriteB.
(2) If SpriteA is to the left of SpriteB, move SpriteA in front of SpriteB if SpriteA's Y position is greater than SpriteB's bottom-back-left corner, else move SpriteA behind SpriteB.
(3) If SpriteA's Y position is greater than SpriteB's bottom-FRONT-left corner, move SpriteA in front of SpriteB, else move SpriteA behind SpriteB.
This is hard to do, as I need to pick specific sprites from the same family and differentiate between them. I think the key may be in the system condition "Pick nth instance", but so far I haven't had any luck.
I'm pretty sure that this is possible! I could just use some helping cracking the puzzle. :) Anything and everything is appreciated!