wired switches and doors

This commit is contained in:
Your Name 2026-08-11 22:55:58 -04:00
parent ee7d36e72b
commit bc4976b324
16 changed files with 2575 additions and 835 deletions

View file

@ -53,6 +53,8 @@ function love.load()
if gameWorld.levels[initialRoom] then
gameWorld.levels[initialRoom] = currentRoom
gameWorld:rebuildCollision()
gameWorld:resolveCircuits()
gameWorld:rebuildCollision()
end
gameWorld:setLastRoom(currentRoom.name)
setEditorRoomName(currentRoom.name)
@ -76,7 +78,7 @@ function love.quit()
end
function love.update(dt)
if editorView == "world" then
if editorView == "world" or editorView == "wire" then
Input:stopMoveRepeat()
else
local repeatedMove = Input:handler(dt)
@ -94,6 +96,8 @@ function love.draw()
love.graphics.setBlendMode("screen")
if editorView == "world" then
gameWorld:draw()
elseif editorView == "wire" then
gameWorld:drawWireEditor(wireEditorCamera())
else
currentRoom:draw()
end
@ -173,10 +177,12 @@ function love.keypressed(key)
return
end
if editorView ~= "world" and Input.isPlayerMove(key) then
if editorView == "wire" and editorWireKeypressed(key) then return end
if editorView ~= "world" and editorView ~= "wire" and Input.isPlayerMove(key) then
Input:beginMove(key)
gameWorld:movePlayer(currentRoom, key)
elseif editorView ~= "world" and Input.isPlayerSwitch(key) then
elseif editorView ~= "world" and editorView ~= "wire" and Input.isPlayerSwitch(key) then
local c = Input.playerColor(key)
gameWorld:switchPlayerColor(currentRoom, c)
end