Advertisement
Guest User

Untitled

a guest
Jun 8th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /// collision_point_list(x,y,obj,prec,notme)
  2. //
  3. //  Returns a list data structure populated with the ids of instances
  4. //  which would collide with a given point, or noone if no instances found.
  5. //
  6. //      x,y         x and y value where to check (real)
  7. //      obj         object to check for collision (or all), (real)
  8. //      prec        Precise collision checking (boolean)
  9. //      notme       Don't check the instance the code is running from (boolean)
  10. //
  11. /// GMLscripts.com/license
  12. {
  13.     var x1,y1,obj,prec,notme,dsid,this,that,i;
  14.     x1 = argument0;
  15.     y1 = argument1;
  16.     obj = argument2;
  17.     prec = argument3;
  18.     notme = argument4;
  19.     dsid = ds_list_create();
  20.     this = id;
  21.     with (obj) {
  22.         that = id;
  23.         with (this) {
  24.             i = collision_point(x1,y1,that,prec,notme);
  25.             if (i != noone) ds_list_add(dsid,i);
  26.         }
  27.     }
  28.     if (ds_list_empty(dsid)) {
  29.         ds_list_destroy(dsid);
  30.         dsid = noone;
  31.     }
  32.     return dsid;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement