Player and object sorting/order in layer
Hi, I am still in the very early stages of my project and haven't really started anything yet, but I have already found a potential area of difficulty regarding appearing behind and in front of objects depending what side I am when standing next to it that may have many different solutions. Anyway, I have a player sprite that is 44 pixels in height, and several object sprites that are smaller than the player so I can not simply add the top part of an object on a higher layer otherwise I would appear underneath it when stood in front of it.
I have thought of one way to combat this and would like to know if there are better ways, or a more standard way to solve this issue.
My project will have grid based movement and I will need to store information in an array for collision information. So, my idea is to sort the players or NPC layer/order in layer based on what grid on the Y axis they are stood on. This way the lowest sprite/object/NPC will always have a higher order than whatever is above it. Collisions will be on the feet of characters and on the bottom half of objects.
Is that okay, or are there better ways of doing it?