Preview adjacent rooms during transitions
This commit is contained in:
parent
23fe9d1c58
commit
794b4dc162
2 changed files with 62 additions and 1 deletions
12
room.lua
12
room.lua
|
|
@ -131,6 +131,10 @@ function Room:update(dt)
|
|||
end
|
||||
|
||||
function Room:draw()
|
||||
if gameWorld and gameWorld.levels and gameWorld.levels[self.name] == self and
|
||||
not gameWorld.drawingRoomNeighborhood then
|
||||
return gameWorld:drawRoomNeighborhood(self)
|
||||
end
|
||||
self:drawWiresAt(0, 0, width / gridWidth, nil, false)
|
||||
|
||||
-- draw only the channels the player has. Each object just exposes sprites per
|
||||
|
|
@ -139,7 +143,13 @@ function Room:draw()
|
|||
for _, channel in ipairs(self.colorsPlayerHas) do
|
||||
if self.player[channel] then self.player[channel]:draw(channel) end
|
||||
for _, entity in pairs(self.collideables[channel]) do entity:draw(channel) end
|
||||
if gameWorld and gameWorld.levels and gameWorld.levels[self.name] == self then gameWorld:drawOverlaps(self, channel) end
|
||||
-- The zoomed-out neighbourhood already draws every room directly. Calling
|
||||
-- the legacy seam helper from each miniature room duplicates foreign
|
||||
-- entities, which can screen-blend red and green into a false yellow.
|
||||
if gameWorld and gameWorld.levels and gameWorld.levels[self.name] == self and
|
||||
not gameWorld.drawingRoomNeighborhood then
|
||||
gameWorld:drawOverlaps(self, channel)
|
||||
end
|
||||
for _, blocker in pairs(self.playerBlockers[channel]) do blocker:draw(channel) end
|
||||
for _, switch in pairs(self.switches[channel]) do switch:draw(channel) end
|
||||
for _, switch in ipairs(self.wiredSwitches) do switch:draw(channel) end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue