Z-ordering on a isometric grid

3

Attached Files

The following files have been attached to this tutorial:

.capx

isometriczorder.capx

Download now 184.07 KB

Stats

3,866 visits, 5,411 views

Tools

Translations

This tutorial hasn't been translated.

License

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.

Published on 16 Sep, 2014. Last updated 19 Feb, 2019

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.

.CAPX

isometriczorder.capx

Download now 184.07 KB
  • 0 Comments

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