Z-ordering on a isometric grid

  • 18 favourites

Attached Files

The following files have been attached to this tutorial:



Download now 184.07 KB


3,361 visits, 4,758 views



This tutorial hasn't been translated.


This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Simply it's a sequel to my other tutorial; Isometric mouse snapping.

Here is the demo.

Put some ground objects.

In the other tutorial we calculated our grid with two target values. We need to store these values for every ground object. Create 2 instance variable for ground object. Don't forget, for every ground object you need different values. You can calculate this values on debug.

If our player not overlapping ground objects, z-order is unimportant. if it overlaps check for the target value. If it's less or equal then the ground object, put it to bottom, else put it to the top.

But what if you have one thousand ground objects. You don't have to enter the instance variable data by hand. By combining our old formulas you can enter instance variables automatically.

You can find the capx.



Download now 184.07 KB

  • Order by
Want to leave a comment? Login or Register an account!