vrld/HardonCollider — Issue #7: testPoint
Author: dannyfritz
Created: 2012-03-04 01:57:30+00:00
State: open

Sorry this isn't a pull request, but I added this function to HC to help out with a project:

```lua
-- Test point for collision with active objects
function HC:testPoint(x, y)
-- collect colliding shapes
local point = newPointShape(x,y);
new_shape(self, point);

local colliding = {};
for _,shape in pairs(point:_getNeighbors()) do
if shape:collidesWith(point) then
table.insert(colliding, shape);
end
end

self:remove(point);

if #colliding == 0 then
return false;
end
return colliding;
end
```