my.state = 0; // waiting for player
while(players_health > 0 && players_life > 0)
{
if(my.state == 0)
{
result = path_scan(me, my.x, my.pan, vector(90, 80, 400));
if (result) {movement_enabled = 1;}
path_getnode (my, 1, pos_node, NULL);
vec_to_angle (my.pan, vec_diff (temp_angle, pos_node, my.x));
ent_animate(my,"frame",my.skill60,ANM_CYCLE);
my.skill60 += 10 * time_step;// my.skill60 += 20 * time_step;
vec_set(zdist.x,nullvector);
vec_set(zabsdist.x,nullvector);
while(1)
{
if ((c_scan(my.x, my.pan, vector(120, 90, 1000), IGNORE_ME) > 0) && (you == player))
{
my.state = 1;
break;
}
dist_to_node = vec_dist(my.x, pos_node);
if(dist_to_node < 10)
{
current_node = path_nextnode(my, current_node, 1);
if (!current_node) {current_node = 1;}
path_getnode (my, current_node, pos_node, NULL);
}
wait(1);
}
}