yea sorry that is correct.. imagine there are 5 lanes.. 1 is the highest and 5 is the lowest.. if you were on lane 3.. and the enemy was on lane 4.. you should appear behind it.. if you were on lane 5 you would appear in front of it.
It seems like in general it's one or the other with my current approach.. either they are all in front or all behind.. and to your z order suggestion that's how I was trying to do it.. at least fundamentally, i'm obviously doing something wrong in my attempt.
the issue for me is that an enemy is spawned off the screen to the right and enters the scene.. the player could move since the moment the enemy is spawned so it first appears correct possibly.. but if the player were to change his position any moment after that object is placed on the screen its no longer right..
So I'm trying to get them to behave dynamically and for some reason something like this isn't working:
on collision with player + not on the same lane as enemy, move enemy behind player (z order).. or even more extreme:
on collision with player + not on the same lane as enemy, move enemy to other layer...
As it is the system is a 5 number ID system that indicates which lane the player is.. if player is on lane 3 when touching an object with a Lane 3 ID then it's a hit / game over condition.. then ideally if the number of enemy is greater or less than the player ID it would be smart enough to snap the object to the appropriate z order or layer... though i'd rather not use layers for performance reasons..