An Easy to Integrate In-Game Console
Posted: Wed Apr 14, 2021 3:05 am
https://github.com/rameshvarun/love-console
It's a single file in-game console that you can use for debugging your games. It's easy to integrate and doesn't take over your game loop or install any globals.
I recently upgraded one of my old libraries to LOVE 11.3. I figured people might find it useful - It's a single file in-game console that you can use for debugging your games. It's easy to integrate and doesn't take over your game loop or install any globals.
Code: Select all
local console = require "console"
function love.keypressed(key, scancode, isrepeat)
console.keypressed(key, scancode, isrepeat)
end
function love.textinput(text)
console.textinput(text)
end
function love.draw()
console.draw()
end
-- This table is available as "player" in the console scope.
console.ENV.player = {x = 100, y = 5}
console.COMMANDS.save = function()
-- This function is run when the user types "save" into the console.
end