collision_circle_list
NOTE: Don't forget to destroy the returned list when you are done with it, otherwise you'll have a memory leak.
/*
** Usage:
** collision_circle_list(x,y,radius,obj,prec,notme)
**
** Arguments:
** x,y center of the collision circle (filled)
** radius radius of the collision circle (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,radius,obj,prec,notme,dsid,i;
x1 = argument0;
y1 = argument1;
radius = argument2;
obj = argument3;
prec = argument4;
notme = argument5;
dsid = ds_list_create();
with (obj) {
if (!notme || id != other.id) {
i = collision_circle(x1,y1,radius,id,prec,false);
if (i != noone) ds_list_add(dsid,i);
}
}
if (ds_list_empty(dsid)) {
ds_list_destroy(dsid);
dsid = noone;
}
return dsid;
}
** Usage:
** collision_circle_list(x,y,radius,obj,prec,notme)
**
** Arguments:
** x,y center of the collision circle (filled)
** radius radius of the collision circle (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,radius,obj,prec,notme,dsid,i;
x1 = argument0;
y1 = argument1;
radius = argument2;
obj = argument3;
prec = argument4;
notme = argument5;
dsid = ds_list_create();
with (obj) {
if (!notme || id != other.id) {
i = collision_circle(x1,y1,radius,id,prec,false);
if (i != noone) ds_list_add(dsid,i);
}
}
if (ds_list_empty(dsid)) {
ds_list_destroy(dsid);
dsid = noone;
}
return dsid;
}
[Please Login]
Projects: 10
Contributor: xot
comments powered by Disqus

Related: collision_circle_list,