use Rect:containsPoint in isThereObjectAt
This commit is contained in:
parent
829963e080
commit
eab4cbbcdc
@ -25,10 +25,7 @@ function isThereObjectAt(x,y,objectType)
|
|||||||
for _, object in pairs(objectType) do
|
for _, object in pairs(objectType) do
|
||||||
if object.is_disabled then
|
if object.is_disabled then
|
||||||
-- Dont calculate if dissabled
|
-- Dont calculate if dissabled
|
||||||
elseif x >= object.from.x
|
elseif object:asRect():containsPoint(Point:new(x, y)) then
|
||||||
and x <= object.to.x
|
|
||||||
and y >= object.from.y
|
|
||||||
and y <= object.to.y then
|
|
||||||
object.is_colliding = true
|
object.is_colliding = true
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user