I'm working on a project with a birds eye view kind of like (Fallout 2 image) and need some help with z-order.
For example: When I place a tree in the layout I want the players index to be higher when he's in front of the tree. The head of the player sprite should cover the tree. But if he's moving behind it the top of the tree sprite should cover the player when walking behind it, meaning that the the z-order of the tree should have changed. Collision boxes are already set to a small square at the base of both the tree and the player sprite, but I cant get the player to be both behind and in front of the tree.
So what I'm looking for is a way to set the z-order of the tree relative to the player position, or according to the grid or something like that. Is that possible and how could it be done? I'm planning to have a lot of these kind of objects, where the player can walk behind them, and the player can also cover them.
Any help appreciated.