LÖVE tools


LÖVE tools, or love2d-tools, is a series of LÖVE utilities, inspired by batteries.

Installation

  1. Clone the repository
git clone https://github.com/Nykenik24/love2d-tools.git

Or add it as a submodule (recommended)

git submodule add https://github.com/Nykenik24/love2d-tools.git path/to/library

You can also download the latest release, but if you want the latest modules and features, i recomend cloning or adding as a submodule. I don’t make a release every time i add a module, only when i make patches or release various modules.

  1. Require the library in your main.lua or the file where you load libraries.
Tools = require("love2d-tools.lib")
-- or you can require every module individually
Class = require("love2d-tools.modules.class")
  1. Now you can use the library, all the modules are documented.
Tools = require("love2d-tools.lib")
ClassTool = Tools.class
DebugTool = Tools.debug --note that lua already has a standard debug library, so don't name the module "debug".
TimerTool = Tools.timer

MyClass = ClassTool {
    smth = "Hello World!",
    other_thing = 5
}
MyClass_obj = MyClass:new()

MyTimer = Timer(5) --5 is the duration of the timer
MyTimer:Update()

MyTimer.OnEnd = function(self) --will be called every time the timer ends
    DebugTool.Equal(MyClass_obj.other_thing, 5)
end

Modules

These are the modules it comes with:

More

To read about contributing, the roadmap, etc., visit the GitHub repository