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
|
||||
} -- this is for reference for each color as we change the targetCells table
|
||||
|
||||
local initialTargetEntities = {}
|
||||
local initialTargetEntity
|
||||
|
||||
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
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue