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({
collisionBetween = {
collider = collider,
collidedInto = e
}
collidedInto = e,
},
})
end
end

View File

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

View File

@ -2,9 +2,7 @@ local world = require("world")
local sqrt = math.sqrt
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
-- velocity = nil
else
if sqrt((e.velocity.x * e.velocity.x) + (e.velocity.y * e.velocity.y)) >= 2 then
e.position.x = e.position.x + (e.velocity.x * dt)
e.position.y = e.position.y + (e.velocity.y * dt)
end