Posted By: kombuwa
Path problem - 02/06/08 03:27
can anyone say good tutorial about path(move entity in a path )?
please,
please,
#define MOVEMENT_SPEED skill1
var dist = 0; // entity path
var vLastPos[3];
var vDir[3];
action the_entity ()
{
path_set(my, "the_path");
while(1)
{
path_spline(me,my.x,dist);
dist += 5*time_step;
vec_diff(vDir,my.x,vLastPos);
vec_to_angle(my.pan,vDir);
vec_set(vLastPos,my.x);
ent_animate(my, "walk", my.MOVEMENT_SPEED, ANM_CYCLE);
my.MOVEMENT_SPEED += 30 * time_step;
wait(1);
}
}
next_nod=path_nextnode(my,path_getnode(me,1,1,my.skill2),path_getedeg(me,1,1,my.skill1));
next_nod= path_scannode(my,path_getnode(my));
ang_c=atan(((next_node.x-curr_node.x)/next_node.y-curr_node.y));
vec_to_angle(my.pan+ang_c,vDir);