-1
\$\begingroup\$

I want to make an isometric game like in the picture.

At point "1" character must be visible and the train car drawn behind the character. At point "2" the train car should cover the character so that the character is behind the train car.

This is not a 3D game but a 2D game, what is the principle called that makes this happen? or maybe there is a good tutorial somewhere.

Thank you.

enter image description here

\$\endgroup\$
  • \$\begingroup\$ It's hard to understand what's the issue your facing. \$\endgroup\$ – Vaillancourt Jul 9 '15 at 19:37
  • 2
    \$\begingroup\$ Please remember to search for similar questions before asking new ones. This has been asked many times. Possible duplicate of IsoMetric Map draw: sort with Topological Sort, Z-Buffer and anchor point or 2D Isometric sorting for multi-tile objects \$\endgroup\$ – DMGregory Jul 9 '15 at 19:43
  • \$\begingroup\$ When I was making game in Unity3d, there was no such problem, but in Cocos2d-x I have sprites if character's z index is 1000 and carriage's z order is 100 at point "1" character will cover the carriage, but when he will move at point "2" the carriage will not cover the character. \$\endgroup\$ – w770115 Jul 9 '15 at 19:45
  • \$\begingroup\$ Thank you, today before post I was searching in google, but I did not knew how to search exactly this problem. Thanks. \$\endgroup\$ – w770115 Jul 9 '15 at 19:48
1
\$\begingroup\$

You will need to take a look at isometric rendering principles. Read more about isometric projection for more details on wiki

Since you are in the 2d space you will need to specify the order of drawing. By drawing things all on the same "layer" you will run into tiles rendering "strangely". By applying proper layering you can draw the farthest away tile(typically top left corner) and draw the rest of the map which will be on a higher layer in order to accomplish the desired rendering.

Will write up some more details this weekend and link them here if it's helpful.

\$\endgroup\$

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