NPC Pathing for dummies.
while curx isn't equal to newx
{
xold = curx;
xnew = (whatever the hell you would do to pull the x out of the line);
time = (whatever you would do to pull the time out);
xmove = (xnew - xold) / time;
while (a < time) do {
xthis = xold + xmove;
}
<repeat this for y and z>
move.npc (xthis, ythis, zthis);
}
This is slightly basterdized code... as in nothing like C++, but as soon as i get it into c++ it'll be pretty nice.
|