2D Toolkit Forum
2D Toolkit => Support => Topic started by: Majicpanda on October 11, 2013, 01:49:39 am
-
I have an RPG type game and characters laid out like the following:
Main Body sprite - z=0
Head equip item - z=-.2
Chest item - z=-.1
mainhand item - z=.1
Offhand item - z=-.3
This all works great except obviously when characters start walking among each other since up to 4 can be on the screen at once and then as you can expect very weird things happen visually with all these depths weaving between each other.
Is there any other better way to do this?
-
You can just put the different characters on different z-depths, too. Like 0, 1, 2, 3. That way, the mainhand items would be at 0.1, 1.1, 2.1, 3.1, for example.
-
This is what I've already done, but if a character moves "down" in the 2d area then they technically need to be rendered on a different Z, so I guess that means I need to have all my characters current Z's being tracked and control some method of changing it when they need to render in front.
http://www.2d-x.com/wp-content/uploads/2011/04/desertbattle.jpg
That's a good example of what I'm doing.
-
That sounds like a sensible solution. Alternatively, if you have a skinned mesh you can have everything draw in one go. But its easier to manage the z yourself.