Movement. Only one side

Hello,

I would like to ask. I stucked on one moment. Does it posibile to make charactor move only left right up or down. I want make 2D game, where camera will look from top, like on this game

112644-hqdefault.jpg

Send please any tutorials, cuz my char can move by diagonally.

Can you show your movement code?