I'm developing a 2D game, tile based with a cenital view (somewhat like bomberman). I've a problem with drawing order for walls and characters. Picture a wall that has a collider 1 tile thick, but the tile above it has some "decoration" to make it look "less cenital", like the top part of the wall. Something like this: The tile 1 has physics, the tile 2 is just decoration. Tile 2 must be on a drawing order higher than the player, to cover its feet if he is above the all. BUT, there is not a good drawing order for the tile 1 that makes it look ok. I've tried: A) Drawing the wall on a higher drawing order than the character: With this approach, if a character is below it and its sprite is taller than 1 tile, then the wall will cover it partially, looking unreal. B) Drawing the wall on a lower drawing order than the character: With this approach, if a character is above it, and some animation has a sprite that goes below its feet, then it will be visible below the tile 2. So... how can I make this look ok?? Thank you very much for your time!
You could set the sorting order based on the player's Y value. If the player's Y value is greater than the sprite's, set the sprite to a higher sorting order. If the player's Y value is less than the sprite's, set the sprite to a lower sorting order.
I was thinking something like that, yes, but I was hoping that some other workaround was possible... Well, I think I'll be going for that. Thanks for your answer!