I'm making an isometric game, so in order to make the movement and positionment smooth, I draw a square that represents the hero in a cartesian map (cartPlayer) at (100,100), so that the isometric char (class isoPlayer) is drawn at (0, 100), and also has a value which is
and is updated everytime I move the cartesian hero (making the isometric hero to move accordingly). The same way, other NPC's (class NPC) and Enemies (class Enemy) are drawn with that extra value.
What I want to do, is to sort the group with THAT "cartX" value, but the function recieves a FlxObject which doesn't have a cartX value, and I'm lost at how to manage the sorting using that value, specially when I have 3 different class types (isoPlayer, isoNPC and isoEnemy) and plan to make an isoOverlayTile for trees, bushes and stuff.