Cool concept but I found what I think is a bug. If you tap two movement keys that go on an angle it puts you outside of the map and you can go anywhere.
Yep, you're right! I made a mistake in the code, thank you for pointing that out!