Thread: Dx Dy
View Single Post
  #5  
Old 04-04-2003, 02:35 AM
Knuckles Knuckles is offline
Registered User
Join Date: Sep 2002
Location: New York
Posts: 580
Knuckles is on a distinguished road
Send a message via AIM to Knuckles
dx = delta x
dy = delta y

vecx stands for vector x -- it's an array of 4 numbers (0,-1,0,1)
vecy stands for vector y -- also an array of 4 numbers (-1,0,1,0)

Now lets look at vecx(0).
... It would look inside the array (0,-1,0,1); and would grab the FIRST number, because all array's start at 0, not 1. So, vecx(0) would return '0'.

if it was vecx(1), it would return the 2nd number of the arra; which is -1... and so on and so forth...

Test script
NPC Code:

if (created) {
this.dir = 1; // change this number all you want, from 0-3.
setplayerprop #c,vecx: #v(vecx(this.dir)) -- vecy: #v(vecy(this.dir));
}

__________________
Knuckles
"They say 60% of the time, it works everytime!"