use Rect:containsPoint in isThereObjectAt

This commit is contained in:
binarycat 2022-03-12 13:56:16 -05:00
parent 829963e080
commit eab4cbbcdc

View File

@ -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