Best way to go about sorting 2D sprites in a "RPG Maker" styled RPG

Posted by Aaron Stewart on Game Development See other posts from Game Development or by Aaron Stewart
Published on 2013-10-18T12:50:35Z Indexed on 2013/10/18 16:15 UTC
Read the original article Hit count: 390

Filed under:
|
|

I am trying to come up with the best way to create overlapping sprites without having any issues. I was thinking of having a SortedDictionary and setting the Entity's key to it's Y position relative to the max bound of the simulation, aka the Z value. I'd update the "Z" value in the update method each frame, if the entity's position has changed at all.

For those who don't know what I mean, I want characters who are standing closer in front of another character to be drawn on top, and if they are behind the character, they are drawn behind.

I'm leery of using SpriteBatch back to front or front to back, I've been doing some searching and have been under the impression they are a bad idea. and want to know exactly how other people are dealing with their depth sorting.

Just ultimately trying to come up with the best method of sorting for good practice before I get too far in to refactor the system effectively.

© Game Development or respective owner

Related posts about XNA

Related posts about 2d