Thread: Help me.
View Single Post
  #18  
Old 08-25-2001, 03:27 AM
kyle0654 kyle0654 is offline
-. .`
kyle0654's Avatar
Join Date: Mar 2001
Posts: 1,000
kyle0654 will become famous soon enough
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?)
Reply With Quote