Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passages through isometric tiles

enter image description hereenter image description hereenter image description hereenter image description here

Above are four images of a character walking along the ground from the bottom right towards the upper left. You can see that the drawing order isn't correct in the third panel.

There doesn't seem to be a "correct order" here. For example if instead of a small guy we had a sprite of a looooong cat going through the door, then no matter if you draw the door first or the cat first, it would be wrong.

enter image description hereenter image description here

How do other game engines handle this? Some hack to prevent this situation from happening? Draw a z-buffer by hand? Some other option that didn't occur to me?

like image 501
Bemmu Avatar asked Mar 10 '11 04:03

Bemmu


1 Answers

The trick is simply to split the tile into pieces. Draw the right half of the arch, then the character, and then the left half.

like image 121
supercat Avatar answered Nov 06 '22 02:11

supercat