Guest User

Untitled

a guest
Jun 4th, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /// @description  scr_collision_circle_list(x1,y1,radius,obj,prec,notme)
  2. /// @param x1
  3. /// @param y1
  4. /// @param radius
  5. /// @param obj
  6. /// @param prec
  7. /// @param notme
  8. //
  9. //  Returns a list data structure populated with the ids of instances
  10. //  colliding with a given circle, or noone if no instances found.
  11. //
  12. //      x1,y1       center of the collision circle (filled), real
  13. //      radius      radius of the collision circle (filled), real
  14. //      obj         object to check for collision (or all), real
  15. //      prec        true for precise collision checking, bool
  16. //      notme       true to ignore the calling instance, bool
  17. //
  18. /// GMLscripts.com/license
  19. {
  20.     var x1,y1,radius,obj,prec,notme,dsid,i;
  21.     x1 = argument0;
  22.     y1 = argument1;
  23.     radius = argument2;
  24.     obj = argument3;
  25.     prec = argument4;
  26.     notme = argument5;
  27.     dsid = ds_list_create();
  28.     with (obj) {
  29.         if (!notme || id != other.id) {
  30.             i = collision_circle(x1,y1,radius,id,prec,false);
  31.             if (i != noone) ds_list_add(dsid,i);
  32.         }
  33.     }
  34.     if (ds_list_empty(dsid)) {
  35.         ds_list_destroy(dsid);
  36.         dsid = noone;
  37.     }
  38.     return dsid;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment