Code:
while(my)
{
If (my.speed == 0)
{
my.speed = random(6)+3;
}
my.direction = 1;
my.pan += random(my.richtung)*time*my.direction;
distance.x = time*my.speed;
distance.y = 0;
distance.z = 0;
vec_set(temp,my.x);
if (vec_dist(my.x, player.x) < 35)
{
ent_remove(player);
}
wait(1);
}
1) You have to put the above code (red color) in a while loop
to let them move continously.
2) You need an event function when player is collided by enemies,
for example :
Code:
player = me;
my.enable_impact = on;
my.event = hitme;
wait(1);
while(player != NULL)
{
my.push = -1;
...
}
function hitme() // put this function above your actions
{
if (event_type == event_impact)
{
.....
.....
}
}