You can adjust the z position. If you wanted a game where objects closer to the player were in front you could adjust z based on the y position for example.
Example here
Basically, you want to update the z position for everything you draw to be at the right “layer” - you can segment groups based on z distance, and have very fine changes for z distance for example 0.47573 …