Does anybody seriously have a clue what the onwall(x, y) function actually checks?
Yes, well, it checks for walls, but where exactly?

I think the first picture is the most exact one, and I seriously doubt that the others are right, but it seems not to be actually working like that in my movement script.
Perhaps it checks for the top left corner of the pixel in picture 1? Scary, isn't it?