Possible Duplicate:
How should I sort images in an isometric game so that they appear in the correct order?

I'm starting work on a simple isometric engine. Everything thing is going great at the moment, but I think I've hit an issue everyone hits. I'm having difficulty getting sorting the depth of a cube.

This image shows the default view (character not near a cube) enter image description here

This image shows the character behind a cube enter image description here

The issue is here, when the character goes in front of the cube. enter image description here

Is there a common solution to this? How would i go about it? Would i need to give a depth to EVERY cube, then somehow work out the current tile the character is on then apply the depth to him? I'm using game maker on a mac and I'm happy to upload the project somewhere if you need to check it out.

Thanks for any input.


1 Answer 1


I made an isometric game in flash once. Never finished it (unreliable artist) but for me, sorting was simply a matter of organizing according to y coordinate. The further down on your screen the block is, the closer to the top layer it should be.

Your character, for example, in the stuffed up picture. The Y coordinate of his foot is greater than the y coordinate of the block that overlaps him. Therefore, he should be in front of it, not behind.

Then if you start having multiple layers in your world, each individual layer of the world is sorted individually. Then drawn bottom upwards.

Just comment if you need more/better explaining


Not the answer you're looking for? Browse other questions tagged .