diff --git a/code/objects.lua b/code/objects.lua index 7f8aa4e..e31c293 100644 --- a/code/objects.lua +++ b/code/objects.lua @@ -25,10 +25,7 @@ function isThereObjectAt(x,y,objectType) for _, object in pairs(objectType) do if object.is_disabled then -- Dont calculate if dissabled - elseif x >= object.from.x - and x <= object.to.x - and y >= object.from.y - and y <= object.to.y then + elseif object:asRect():containsPoint(Point:new(x, y)) then object.is_colliding = true return true end