added rooms
This commit is contained in:
@@ -162,6 +162,10 @@ end
|
||||
-- checks if the the reciever would collide with an object if it was positioned at the given point.
|
||||
-- also marks collisioned tile as collision true
|
||||
function Entity:isCollidingAt(x,y,object)
|
||||
return self:getCollidingAt(x,y,object) ~= nil
|
||||
end
|
||||
|
||||
function Entity:getCollidingAt(x,y,object)
|
||||
for _, collision in pairs(object) do
|
||||
if collision.disable then
|
||||
-- Dont calculate if disabled
|
||||
@@ -171,10 +175,10 @@ function Entity:isCollidingAt(x,y,object)
|
||||
and y + self.boxCollision.to.y > collision.from.y
|
||||
then
|
||||
collision.isColliding = true
|
||||
return true
|
||||
return collision
|
||||
end
|
||||
end
|
||||
return false
|
||||
return nil
|
||||
end
|
||||
|
||||
function Entity:isCollidingWith(entity)
|
||||
|
||||
Reference in New Issue
Block a user