sound and other misc fixes

This commit is contained in:
Your Name 2026-08-12 12:27:52 -04:00
parent 38eaba2fa6
commit 176216df8e
6 changed files with 97 additions and 15 deletions

View file

@ -140,6 +140,9 @@ function Room:getRenderChannels()
for _, color in ipairs({"red", "green", "blue"}) do
if self.player[color] then table.insert(channels, color) end
end
-- No player copy lives here, so the view would be black. In debug/dev mode
-- render every channel instead, letting whole (player-less) levels be seen.
if #channels == 0 and DEBUG then return {"red", "green", "blue"} end
return channels
end
@ -456,6 +459,7 @@ function Room:movePlayerLocal(key)
end
if moved then
if Sound then Sound.play("playerMove") end
if useWorld then gameWorld:playerJoinCheck(self, previousPositions, newPositions)
else self:playerJoinCheck(previousPositions, newPositions) end
self:tick()
@ -1119,6 +1123,7 @@ function nextRoom(pos)
local currentName = currentRoom.name
local nextName = gameWorld and currentName and gameWorld:getNeighbor(currentName, exit)
if Sound and nextName and nextName ~= currentName then Sound.play("levelChange") end
currentRoom:save()
-- Missing map neighbours intentionally wrap back into the room just exited.