tidied up bump chec
This commit is contained in:
parent
1c1ec291a7
commit
df7dd1b1f3
1 changed files with 5 additions and 7 deletions
10
room.lua
10
room.lua
|
|
@ -168,17 +168,15 @@ function Room:movePlayer(key)
|
||||||
x = pos.x + dir.x, y = pos.y + dir.y
|
x = pos.x + dir.x, y = pos.y + dir.y
|
||||||
} -- this is for reference for each color as we change the targetCells table
|
} -- this is for reference for each color as we change the targetCells table
|
||||||
|
|
||||||
local initialTargetEntities = {}
|
local initialTargetEntity
|
||||||
|
|
||||||
for _, color in pairs(self:getActiveColors()) do
|
initialTargetEntity = self:getCellInMatrix(self.collidableMatrices[color], initialTargetCell)
|
||||||
initialTargetEntities[color] = self:getCellInMatrix(self.collidableMatrices[color], initialTargetCell)
|
if initialTargetEntity then initialTargetEntity:bump() end
|
||||||
if initialTargetEntities[color] then initialTargetEntities[color]:bump() print(bump) end
|
|
||||||
end
|
|
||||||
|
|
||||||
if not self:isInBounds(initialTargetCell) then
|
if not self:isInBounds(initialTargetCell) then
|
||||||
-- let's us move out of bounds to Change Rooms without pulling a bloc_
|
-- let's us move out of bounds to Change Rooms without pulling a bloc_
|
||||||
move = true
|
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
|
--we should put this in the else statement actually
|
||||||
move = true
|
move = true
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue