move repeatedly in direction
This commit is contained in:
parent
e065ab83de
commit
f8e3d78332
5 changed files with 126 additions and 62 deletions
5
room.lua
5
room.lua
|
|
@ -489,7 +489,10 @@ function Room:switchCheck()
|
|||
local onSwitches = {}
|
||||
for _, switch in pairs(switchArray) do
|
||||
local targetCell = self:getCellInMatrix(self.collidableMatrices[color], switch:getGridPos())
|
||||
if targetCell then
|
||||
local player = self.player[color]
|
||||
-- Players are not stored in collidableMatrices, but a colour copy
|
||||
-- standing on its matching switch presses it just like a block does.
|
||||
if targetCell or (player and player:occupiesCell(switch:getGridPos())) then
|
||||
--switch is on
|
||||
switch:activate()
|
||||
table.insert(onSwitches, switch) --doesn't rly matter what we put here as long as it's true-y
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue