Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
add comment

marked as duplicate by bummzack, Tetrad Jun 13 '11 at 15:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

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

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.