Quote:
Originally Posted by Chompy
Yeah, but using if (player.dir in |0,2| ? k : 0) would give you the variable k if you are facing down, left and up..
As |0,2| doesn't mean 0 or 2, it means 0, 2 and anything between.
And do you know what vectors are? And how they work? And could you tell me why you are using 17/16 in your onwall calculations?
Because.. 17 divided by 16 is 1.0625 and in the long go it will eventually jump over a few tiles to check..
|
The |a, b| thing is a mistake I suppose. He's still quite new to coding. I explained him how vectors work, and using 17 / 16 will result in checking almost exactly one pixel out of the bounding box of the player.