Az movement

This is a text-based game. User can view a colored ascii map in their browser and a group of buttons. User can click buttons to determine direction they want their character to move. Characters can circumnavigate world. 
This method is a little long and complicated. Do you think you could refactor it?