Thread: Onwall-Check
View Single Post
  #11  
Old 11-23-2008, 03:28 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Chompy View Post
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.
Reply With Quote