Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.

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

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