speed=2
if(point_distance(x,y,Char.x,Char.y) < 150 and collision_line(x,y,Char.x,Char.y,tower,1,1)=-4 ) {
mp_potential_step(Char.x,Char.y,speed,0); //move towards the character avoiding all solid objects
}
else {
tx = random(room_width);
ty = random(room_height); //create a random point to move to
mp_potential_step(tx,ty,speed,0); //move towards the random point
}
Speed in the first row you can change, it is speed of enemy. And distance (150) change also, 150 pixels is about 1.8 inch/4,7 cm.
carbon28
Member Since 19 Jul 2011Offline Last Active Jan 17 2012 07:09 PM



Find content
Not Telling
