
Hey look it’s a code post for our video game! ..Wait please come back, don’t go back to Facebook! I’ll explain it thoroughly.
Say you’re making a top-down game or a three-quarter view game and you have a masked object like this:

Set up with some other basic movement code, other objects in the game won’t be able to go through the mask. Thing is we want our units to be able to go behind and in front of the Cloudmobile. Having a static depth doesn’t do that for us.

There you have it! Objects behind stay at a larger depth than those in front. Further posts will refer to the game as Project 9-bit. We plan on having 3/4 view as well as sidescroller and possibly other styles. Hope you enjoyed this simple tutorial.
Thanks to Game Sprite Archives for continually supplying win and Nintendo for making a 5 star game.