idk even anymore

This commit is contained in:
Your Name 2026-08-07 01:39:47 -04:00
parent 7fa9171ba1
commit febaaaacc7
13 changed files with 2239 additions and 1508 deletions

View file

@ -10,6 +10,8 @@ require "_helpers"
require "input"
require "color"
require "room"
require "world"
require "world_seed"
require "shaders"
require "level_editor/editor"
@ -20,6 +22,7 @@ function love.load()
_initGridVars()
_initSounds()
_initGlobalColors()
gameWorld = World:new()
_initLevelEditor()
gameCanvas = love.graphics.newCanvas()
@ -32,6 +35,7 @@ function love.load()
currentRoom = Room:new{
name = "start" -- TEMP: load a migrated level to eyeball it; revert once the room picker lands
}
setEditorRoomName(currentRoom.name)
response = ""
end
@ -48,7 +52,11 @@ function love.draw()
love.graphics.setCanvas(gameCanvas)
love.graphics.clear()
love.graphics.setBlendMode("screen")
currentRoom:draw()
if editorView == "world" then
gameWorld:draw()
else
currentRoom:draw()
end
love.graphics.setCanvas(finalCanvas)
love.graphics.clear()
@ -85,9 +93,9 @@ function love.draw()
end
function love.keypressed(key)
if Input.isPlayerMove(key) then
if editorView ~= "world" and Input.isPlayerMove(key) then
currentRoom:movePlayer(key)
elseif Input.isPlayerSwitch(key) then
elseif editorView ~= "world" and Input.isPlayerSwitch(key) then
local c = Input.playerColor(key)
currentRoom:switchPlayerColor(c)
end
@ -115,7 +123,7 @@ function love.keypressed(key)
end
function love.mousepressed(x, y, button)
if button == 2 then
if editorView == "room" and button == 2 then
currentRoom:attemptDelete(x, y, selectedColor)
end
editorMouseHandler(x, y, button)
@ -175,4 +183,3 @@ function _initSounds()
static:setVolume(.15)
static:play()
end