Comment out some unused input.lua logic

Finally back to a state where luacheck passes
This commit is contained in:
Sage Vaillancourt 2025-03-19 15:50:26 -04:00
parent 7a3528df40
commit bec3e8e68b
3 changed files with 29 additions and 31 deletions

View File

@ -37,8 +37,8 @@ world:filteredSystem(
system.world:addEntity({ system.world:addEntity({
collisionBetween = { collisionBetween = {
collider = collider, collider = collider,
collidedInto = e collidedInto = e,
} },
}) })
end end
end end

View File

@ -18,33 +18,33 @@ function love.keypressed(key, _, _)
keyState[key] = true keyState[key] = true
end end
function ClearKeyState() -- function ClearKeyState()
for key in pairs(keyState) do -- for key in pairs(keyState) do
keyState[key] = nil -- keyState[key] = nil
end -- end
end -- end
local mouse = world:filteredSystem("mouse", { mouseKeyPress = { position = T.XyPair, key = T.number } }) -- local mouse = world:filteredSystem("mouse", { mouseKeyPress = { position = T.XyPair, key = T.number } })
--
function MouseJustPressed(key, clear) -- function MouseJustPressed(key, clear)
clear = clear ~= nil and clear or true -- clear = clear ~= nil and clear or true
for _, event in pairs(mouse.entities) do -- for _, event in pairs(mouse.entities) do
if event.mouseKeyPress and event.mouseKeyPress.key == key then -- if event.mouseKeyPress and event.mouseKeyPress.key == key then
if clear then -- if clear then
event.mouseKeyPress = nil -- event.mouseKeyPress = nil
world:removeEntity(event) -- world:removeEntity(event)
end -- end
return true -- return true
end -- end
end -- end
return false -- return false
end -- end
--
local mouseX, mouseY = -9999, -9999 -- local mouseX, mouseY = -9999, -9999
--
function love.mousemoved(x, y) -- function love.mousemoved(x, y)
mouseX, mouseY = x, y -- mouseX, mouseY = x, y
end -- end
function love.mousepressed(x, y, key) function love.mousepressed(x, y, key)
world:addEntity({ world:addEntity({

View File

@ -2,9 +2,7 @@ local world = require("world")
local sqrt = math.sqrt local sqrt = math.sqrt
world:filteredSystem("velocity", { position = T.XyPair, velocity = T.XyPair }, function(e, dt, _) world:filteredSystem("velocity", { position = T.XyPair, velocity = T.XyPair }, function(e, dt, _)
if sqrt((e.velocity.x * e.velocity.x) + (e.velocity.y * e.velocity.y)) < 2 then if sqrt((e.velocity.x * e.velocity.x) + (e.velocity.y * e.velocity.y)) >= 2 then
-- velocity = nil
else
e.position.x = e.position.x + (e.velocity.x * dt) e.position.x = e.position.x + (e.velocity.x * dt)
e.position.y = e.position.y + (e.velocity.y * dt) e.position.y = e.position.y + (e.velocity.y * dt)
end end