This is what I had in mind when setting it up, but as you can see, no luck. :(
proc/Collisions(Dir)
// collision detection setup;
var/list/collisions = new
var/turf/collisionTurf = get_step(src,Dir)
// collision detection turf contents;
var/dx = abs(x - collisionTurf.x)
var/dy = abs(y - collisionTurf.y)
var/circle = sqrt(dx*dx + dy*dy)
// collision detection turf;
if(circle < (radius + collisionTurf.radius))
collisions += collisionTurf
// collision detection contents;
var/atom/collision
// collision detection loop;
for(collision in collisionTurf.contents)
// collision detection item;
dx = abs(x - collisionTurf.x)
dy = abs(y - collisionTurf.y)
circle = sqrt(dx*dx + dy*dy)
// bump check;
if(circle < (radius + collision.radius))
world<<"c"
collisions += collision
// return results;
return collisions
The formula for detection is
(abs(x-c.x))2+(abs(y-c.y))2
And to detect if there are collisions in a certain spot I do
// collision detection contents;
var/list/collisions = Collisions(Dir)
// collision detection check;
if(collisions && collisions.len)
return
Ideas?