tidied up bump chec

This commit is contained in:
0x81c 2015-03-16 07:43:02 -04:00
parent 1c1ec291a7
commit df7dd1b1f3

View file

@ -168,17 +168,15 @@ function Room:movePlayer(key)
x = pos.x + dir.x, y = pos.y + dir.y
} -- this is for reference for each color as we change the targetCells table
local initialTargetEntities = {}
for _, color in pairs(self:getActiveColors()) do
initialTargetEntities[color] = self:getCellInMatrix(self.collidableMatrices[color], initialTargetCell)
if initialTargetEntities[color] then initialTargetEntities[color]:bump() print(bump) end
end
local initialTargetEntity
initialTargetEntity = self:getCellInMatrix(self.collidableMatrices[color], initialTargetCell)
if initialTargetEntity then initialTargetEntity:bump() end
if not self:isInBounds(initialTargetCell) then
-- let's us move out of bounds to Change Rooms without pulling a bloc_
move = true
elseif initialTargetEntities["red"] and initialTargetEntities["red"]:canPassOver() then
elseif initialTargetEntity and initialTargetEntity:canPassOver() then
--we should put this in the else statement actually
move = true
else