PDA

View Full Version : Help with onwall


mystic_pheonix
08-01-2001, 12:16 AM
can someone give me a working onwall script so you dont go through walls? if you do ill give you credit it my script and send you a copy :)

Shard_IceFire
08-01-2001, 02:37 AM
well if it's for an NPC, i THINK (key word=think) it would be like this:

if (onwall(x,y-1.5)) {
y++;
}
if (onwall(x,y+1.5)) {
y--;
}
if (onwall(x+.5,y)) {
x--;
}
if (onwall(x-.5,y)) {
x++;
}

LiquidIce00
08-01-2001, 05:26 AM
I dont know where I stuck mine at but the best way is to make an array with .25,.5,.75,1 ... blabla then u just run thru the array (and use vecx and vecy) to check the tiles infront of the player.

mystic_pheonix
08-01-2001, 05:50 AM
uhhhh... okay