Very easy and simple "Doom like" sprite based character

It should work now and I added a drawing showing the basic math behind the large function.