I need some help figuring out how to get my character and NPC sprites to properly layer when they're in front and behind of each other. What I want to do is this:
<img src="http://i.imgur.com/jzZnCtD.png" border="0" />
Where when the red sprite is in front of the blue sprite it shows up on top, but when the red sprite is behind the blue sprite the blue sprite is on top. Working with single layers just ends up with one sprite always being on top, regardless of position:
<img src="http://i.imgur.com/8iqRw8i.png" border="0" />
Is the best way to handle this to cut my sprites in half at the waist with the waist-down being on a lower layer than the waist up? If I put the collision box in the lower half, the sprites should be able to line up properly:
<img src="http://i.imgur.com/5BF3Qea.png" border="0" />
So, that works, but I'm posting here in hopes of there being a better way, whether there's a function I didn't know about, or a behavior someone's published, or just an easier trick someone thought up.
Thanks in advance.