Not sure if anyone else has made a better one since but I have a z-ordering example for this kind of game
Example
If you don't need different heights as well, as is the case in the example, then its just using 'For Each Ordered - by Y position - Move to top of layer.