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
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user