Help With moving up, down, etc, but not like a spaceship

How do i make charters move around like in Pokemon or the older legend of Zelda

Similar to sideways movement, but now you have 2 extra keys, both of which go into numbers that go into the Y axis.

I have a game that uses this mechanic, you can look at the behaviours. https://flowlab.io/game/play/608692