Z-order in top-down 2d games

This tutorial is language agnostic. It doesn’t contain implementation, because it may differ a lot between different languages or frameworks. Ideas themselves are what’s the most important, I think.


So, what is z-order?
Z-order is an ordering of overlapping 2d objects. Look at the picture:

Rectangle B is drawn after rectangle A. The result is rectB is drawn “above” rectA. RectB is said to have higher z-order than rectA. Really simple.
Continue reading