Advertisement
CaptainLepidus

Sticky Enemies

Mar 1st, 2012
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Create:
  2. target=-4;
  3. Step:
  4. if target!=-4
  5. {
  6. if distance_to_object(obj_enemy)>32
  7. {
  8. var dir;
  9. dir=point_direction(x,y,target.x,target.y);
  10. x=x+lengthdir_x(4,dir);
  11. y=y+lengthdir_y(4,dir);
  12. }
  13. }
  14. Collision with obj_enemy:
  15. if other.target==-4 and target==-4
  16. {
  17. target=other.id;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement