I think you’ve kind of hidden code in your tile structure. Here, for instance:
How can you know which way is forward when you make the array?
Just to be clear: Do you want W to always move the player in the direction they are looking, or always move ‘north on the map’?