Hi, at the moment I programm a AI. This I follows a path an on each edge it wait.
If the AI see the player it attack. But in the time, while it is wait at the
edge, it doesn't shoot on the player. I try this, but it don't work.
Code:
if(c_trace(my.x, player.x, ignore_me + ignore_passable) > vec_dist(my.x, player.x) - 50)
{
see_player:
vec_set(temp, player.x);
vec_sub(temp, my.x);
vec_to_angle(my.pan, temp);
my.tilt = 0;
my.roll = 0;
my.skill53 = 0;
my.take_shoot = 0;
my.skill52 = 0;
while(my.skill52 < 100)
{
ent_animate(me, "attack", my.skill52 , null);
my.skill52 += 8 * time_step;
//enemy_shoot();
wait(1);
}
while(my.skill53 < 100)
{
if(c_trace(my.x, player.x, ignore_me + ignore_passable) > vec_dist(my.x, player.x) - 50)
{
goto(see_player);
}
ent_animate(me, "stand", my.skill53, anm_cycle);
my.skill53 += 8*time_step;
wait(1);
}
}
Mfg, Pingulord