collision_ellipse_list

! NOTE: Don't forget to destroy the returned list when you are done with it, otherwise you'll have a memory leak.

Downloadcollision_ellipse_list(x1,y1,x2,y2,obj,prec,notme)   Returns a ds_list of all instances of the given object colliding with the given filled ellipse.
/*
**  Usage:
**      collision_ellipse_list(x1,y1,x2,y2,obj,prec,notme)
**
**  Arguments:
**      x1,y1       corner of the collision ellipse (filled)
**      x2,y2       opposite corner of the collision ellipse (filled)
**      obj         object to check for collision
**      prec        set to true for precise collision checking
**      notme       set to true to ignore the calling instance
**
**  Returns:
**      a ds_list id, or keyword noone if no instances are found
**
**  GMLscripts.com
*/


{
    var x1,y1,x2,y2,obj,prec,notme,dsid,i;
    x1 = argument0;
    y1 = argument1;
    x2 = argument2;
    y2 = argument3;
    obj = argument4;
    prec = argument5;
    notme = argument6;
    dsid = ds_list_create();
    with (obj) {
        if (!notme || id != other.id) {
            i = collision_ellipse(x1,y1,x2,y2,id,prec,false);
            if (i != noone) ds_list_add(dsid,i);
        }
    }
    if (ds_list_empty(dsid)) {
        ds_list_destroy(dsid);
        dsid = noone;
    }
    return dsid;
}

Click if you've used this script[Please Login]
Projects: 1


comments powered by Disqus