move repeatedly in direction

This commit is contained in:
Your Name 2026-08-07 02:01:39 -04:00
parent e065ab83de
commit f8e3d78332
5 changed files with 126 additions and 62 deletions

View file

@ -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