src.layer = MOB_LAYER + (world.maxy - src.y)/world.maxy
Problem description:
The above code works well for pixel movement and layers, allowing you to move in front of a tree and be in front of it visually, and move behind it and be behind it visually. But I'm having a lot of trouble figuring out how to include step_y into the equation, so that if an obj or mob is displaced by so many number of pixels, everything works as it should visually. Could anyone help me? Maths isn't my strong point.
TILE_HEIGHT should be the height of a tile in pixels according to your world.icon_size value.