An Easy to Integrate In-Game Console

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
varunprime
Prole
Posts: 6
Joined: Sun Apr 12, 2015 12:30 am
Contact:

An Easy to Integrate In-Game Console

Post by varunprime »

demo.png
demo.png (272.02 KiB) Viewed 1186 times
I recently upgraded one of my old libraries to LOVE 11.3. I figured people might find it useful - 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.

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
User avatar
Gunroar:Cannon()
Party member
Posts: 282
Joined: Thu Dec 10, 2020 1:57 am

Re: An Easy to Integrate In-Game Console

Post by Gunroar:Cannon() »

Yeah!! I totally fond it useful. I've wanted something like this for a while.
Check out Dust
me: I don't always code but when I do it's done flawlessly.
also me:

Code: Select all

 function Gunroar:Cannon()
    for x, enemy in ipairs(self.allEnemies) do
        self:Cannon(enemy)
    end
end

Code: Select all

Lua Error: [file Gunroar.lua]:18: C stack overflow
User avatar
Xii
Citizen
Posts: 90
Joined: Thu Aug 13, 2020 9:09 pm
Contact:

Re: An Easy to Integrate In-Game Console

Post by Xii »

Looks simple, clean, and very useful, indeed. Thanks for sharing, will probably use. :)
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests