While creating my RPG-like game, I started wondering how I would handle layering in my game to make it look like the player is walking behind or in front of certain objects. To clarify my question, have a look at the image below:
I found this image on Discord and is not mine. Still, this is an example of what I want to avoid with my own game, which works in a similar way. The player is expected to be in front of the fence, and not partially behind it.
Does anyone have a way to fix this problem? Help would be really appreciated!
Are u using your own code or extended? If it’s your own draw the tiles in rows starting from the top and finishing at the location of your player.
Then. Draw your player followed by the rest of the tiles
I am aware of the LayerDepth parameter, and I am using this. But my question is what the best way is to display the player both behind and in front of the player when needed.