# how to handle the virtual Z axis in 2D games?

I'm using this paper 2d framework of UE4 where a plane mapped with sprite texture is put in 3d world and therefore appears as 2D when viewed from sideways.

Its all good for games like NES mario where other than jumping you can only move along X axis.

However if you look at games like double dragon and Battletoads they have an isometric perspective and a virtual third co-ordinate axis which points outwards from the screen towards the player, you walk along this with d-pad up and down. It also works for objects in the scene such as a box or ladder which you can climb up and down along this axis, it also affects the game logic say like where your character's landing point would be when you jump.

how would you go about implementing this using 3d planes mapped to 2d textures without making some virtual co-ordinate system of your own?

Something very simple I used on Tiny Avengers and many other mini beat'em all was to link the Y axis to the Z axis.

The more the object is up the more in depth it will be.

So if your character is at 25 on Y it will also be at 25 on Z... which means that a crate placed at 20 on Y will be displayed in front of the player and will give an effect of depth.

Also I would suggest you to apply a slower speed movement for the Y axis than the one applied on the X axis.

The Battletoads solution is not quite isometric. It's drawn pseudo-isometric but the movement isn't. It's a regular square coordinate system except you move up and down slower to make it feel isometric-ish.

The world XY position of the toad is the position on the ground as marked by the shadow. During jumps the jump height (world Z) is added to the world Y coordinate of the Sprite to make screen Y (world X and screen X are the same). When a pig swings its axe at your shadow it compares the relative jump heights to see if it's a hit or not.

To complicate things, some interactions (like catching flies) are done in screen space. So, if the toad's screen XY and fly's screen XY line up then you catch it no matter your world coordinates.

If you're doing proper isometric then screenX=worldX-worldY and screenY=(worldX+worldY)/2+worldZ but the controls wont feel right on D-pad (check out the feel of Solstice)