Quote:
Originally posted by BocoC
I made a perfect onwall script, but I am too lazy to extract the code from my npc. But, basically it checks every half a tile for an onwall statement. Every time it checks, it adds 0.5 to a counter. Now, if you are doing this:
playerx++;
Then if it detects a wall inbetween the starting point and destination of the player, it uses the counter to place the player in front of the wall. It's kinda complicated, but it works perfectly.
|
Fun (though you'll find that .5 tiles aren't quite accurate enough if you do anything really advanced). 1/16 tiles would be incredibly accurate, but also somewhat inefficient.
(Washington eh?)