1. Make an actor called Target
2. Make 3 global variables, targetx, targety, auto
3. Enemy-DrawActor:
- Code: Select all
if(distance(x,y,player.x,player.y)<=200){auto=1;}
if(auto==1){targetx=x;targety=y;}
4. Enemy-DestroyActor:
- Code: Select all
auto=0;
5. Target-DrawActor:
- Code: Select all
x=targetx;y=targety;transp=(auto-1)*-1;
6. Shot-CreateActor:
- Code: Select all
if(auto==1){angle=direction(x,y,targetx,targety);directional_velocity=15;}