Advertisement
CaptainLepidus

instance_nearest_enemy

Apr 2nd, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.     var ds,selected;
  3.     ds = ds_priority_create();
  4.     ds_priority_add(ds,noone,100000000);
  5.     with (argument2) {
  6.         if (image_blend != other.image_blend) {
  7.             ds_priority_add(ds,id,point_distance(argument0,argument1,other.x,other.y));
  8.         }
  9.     }
  10.     selected = ds_priority_find_min(ds);
  11.     ds_priority_destroy(ds);
  12.     return selected;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement