{"id":23436305,"url":"https://github.com/nykenik24/love2d-tools","last_synced_at":"2026-02-19T08:36:18.834Z","repository":{"id":268237023,"uuid":"903726473","full_name":"Nykenik24/love2d-tools","owner":"Nykenik24","description":"Love2d tools (or love2d-tools) is a series of LOVE2D game framework utilities to make developing games with Love2d easier and faster.","archived":false,"fork":false,"pushed_at":"2025-02-14T18:33:44.000Z","size":1837,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T04:12:35.759Z","etag":null,"topics":["game-development","helpers","library","love2d","modules","tools","utilities"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nykenik24.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-15T12:05:49.000Z","updated_at":"2025-02-14T18:33:48.000Z","dependencies_parsed_at":"2024-12-15T13:20:09.557Z","dependency_job_id":"d50f5dbd-ac2e-485d-92d8-13ba5ffc52b1","html_url":"https://github.com/Nykenik24/love2d-tools","commit_stats":null,"previous_names":["nykenik24/love2d-tools"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nykenik24%2Flove2d-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nykenik24%2Flove2d-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nykenik24%2Flove2d-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nykenik24%2Flove2d-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nykenik24","download_url":"https://codeload.github.com/Nykenik24/love2d-tools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248661722,"owners_count":21141451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game-development","helpers","library","love2d","modules","tools","utilities"],"created_at":"2024-12-23T13:18:20.661Z","updated_at":"2026-02-19T08:36:18.786Z","avatar_url":"https://github.com/Nykenik24.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php) [![Open Source Love](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/) \n\n# Love2d tools 🛠\n\u003e Love2d tools is inspired by [batteries.lua](https://github.com/1bardesign/batteries/).\n\n**Love2d tools** *(or love2d-tools)* is a series of **[LOVE2D game framework](https://love2d.org)** utilities to make developing games with Love2d easier and faster. It can make your game developing\nexperience a little bit better by providing useful tools that almost every game engine has, but Love2d lacks off.\\\n\\\nIt comes with OOP, Timers, a Debugging helper, etc. All modules can be seen [here](\u003cREADME.md#Made modules\u003e).\\\n\\\n\u003e note: Love2d tools is **NOT** perfect, and you should know that bugs can occur and that it is currently **Work In Progress**.\n\n### Disclaimer\nAll modules, methods, variables, etc. are subject to change. Breaking changes **will try to be avoided**, **but**, if they are necessary a backup of the current version will be made so you can\ndownload it in case you update by accident. If any pull request that makes a breaking change is merged, a release with the previous version will be added. This means that **you** are responsible\nfor going to the previous version if your project breaks\\\n\\\nIf a breaking change is not fixed, the previous version is not backed up or any other issue related to breaking changes, [open an issue](https://github.com/Nykenik24/love2d-tools/issues).\n\n## Table of contents\n- [Installation](README.md#Installation)\n- [Modules](README.md#Modules)\n    - [Work in Progress](\u003cREADME.md#Work in Progress modules\u003e)\n    - [Made](\u003cREADME.md#Made modules\u003e)\n    - [Considered](\u003cREADME.md#Considered modules\u003e)\n- [Roadmap](README.md#Roadmap)\n- [More information](\u003cREADME.md#More information\u003e)\n    - [Inspiration](README.md#Inspiration)\n    - [Contributing](README.md#Contributing)\n- [Making modules](\u003cREADME.md#Making modules\u003e)\n- [Links](README.md#Links)\n\n## Installation\n1. Clone the repository\n```bash\ngit clone https://github.com/Nykenik24/love2d-tools.git\n```\nOr add it as a submodule **(recommended)**\n```bash\ngit submodule add https://github.com/Nykenik24/love2d-tools.git path/to/library\n```\nYou 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\nmake patches or release various modules.\n\n2. Require the library in your `main.lua` or the file where you load libraries.\n```lua\nTools = require(\"love2d-tools.lib\")\n-- or you can require every module individually\nClass = require(\"love2d-tools.modules.class\")\n```\n\n3. Now you can use the library, all the modules are documented.\n```lua\nTools = require(\"love2d-tools.lib\")\nClassTool = Tools.class\nDebugTool = Tools.debug --note that lua already has a standard debug library, so don't name the module \"debug\".\nTimerTool = Tools.timer\n\nMyClass = ClassTool {\n    smth = \"Hello World!\",\n    other_thing = 5\n}\nMyClass_obj = MyClass:new()\n\nMyTimer = Timer(5) --5 is the duration of the timer\nMyTimer:Update()\n\nMyTimer.OnEnd = function(self) --will be called every time the timer ends\n    DebugTool.Equal(MyClass_obj.other_thing, 5)\nend\n```\n\n# Modules\nHere all modules are listed.\\\n\\\nIf you contribute making a module, list it here with this format:\n```markdown\n## Made modules\n- **ModuleName** (`filename`): Brief description.\n```\n\n## Work in Progress modules\n- **Stringx** (`string`): String handling extension. **Category**: Lua extensions.\n\u003e NOTE: Modules may be added in the future\n## Made modules\n\n### General utilities\n- **OOP** (`class`): Class system, has: objects *(obviously)*, subclasses, *\"merging\"* and *\"cloning\"* classes; etc.\n- **Timer** (`timer`): Allows to create timers, has an automatic `update` method and an `OnEnd` method that you can customize.\n- **Input** (`input`): Mouse/keyboard input helper.\n\n### Event handling\n- **MessageBus** (`messagebus`): Message bus that handles publishers and suscribers. Made by *[zalanwastaken](https://github.com/zalanwastaken)*.\n- **StateMachine** (`state`): State machine that handles: info, an update function, etc.\n\n### Geometry and mathematics\n- **Easing** (`easing`): Easing helper to make smoother movement or ease values. Licenses of used resources in the [licenses directory](https://github.com/Nykenik24/love2d-tools/tree/main/licenses).\n- **Vector2** (`vec2`): Simple vec2 system.\n\n### Lua extensions\n- **Mathx** (`math`): Useful math functions not present in `lua` and `love2d`.\n- **Tablex** (`table`): Table handling extension. **Category**: Lua extensions.\n\n### Development helpers\n- **Logger** (`logger`): Logging module that uses a separate thread for minimum performance impact. Made by *[zalanwastaken](https://github.com/zalanwastaken)*.\n- **Debug** (`debug`): Basic debug utility with assert functions.\n\n### Data managing\n- **Database** (`database`): Database-like data managing system. Made by *[zalanwastaken](https://github.com/zalanwastaken)*.\n- **Set** (`set`): Simple set implementation.\n\n## Considered modules\n*New ideas will be added here before being added to W.I.P modules.*\n\n- Simple JSON parser\n\n\n### Ideas\nIf you have any module idea open an issue and i will try to answer and implement your idea.\n\n# Roadmap\n- Finish all currently W.I.P modules.\n\n# More information\n## Inspiration\n- 1bardesign/**batteries**: https://github.com/1bardesign/batteries/\n\n## Contributing\nTo contribute to the project, follow these steps:\n1. Fork the repository\n2. Make all the changes you consider\n3. Make a pull request\n\nI will try to answer as fast as posible. If i don't answer, [send me an email](mailto:Nykenik24@proton.me).\n\u003e If the link doesn't work, my email is Nykenik24@proton.me\n\nFor more info, read [CONTRIBUTING.md](CONTRIBUTING.md)\n\n# Making modules\nI'll explain to you how i make every module. This can help if you want to [contribute](README.md#Contributing).\n\n### 1. Create the file\nWhen creating the files i try to name them as short as possible, without using more than one word. This is because is way more easy to manage files with simple names and for you to understand\nwhat every module does looking at the file name.\n### 2. Write the module base\nEvery module has this base:\n```lua\nlocal M = {}\n\nreturn M\n```\nSome modules are classes, so i need to add some extra lines.\n```lua\nlocal class = require(\"modules.class\")\nlocal M = {}\n\nlocal M_class = class(M)\nreturn M_class\n```\n### 3. Make every method and variable\nNow that i have the module base, i need to make every method and every variable.\n```lua\nlocal class = require(\"modules.class\")\nlocal M = {}\nM.SomeRandomVariable = \"!dlroW olleH\"\n\nfunction M.SomeRandomMethod(self)\n    return self.SomeRandomVariable\nend\n\nlocal M_class = class(M)\nreturn M_class\n```\nBut, wait. If you see the modules that are classes, you will notice how they have a `new()` method being returned.\n```lua\nlocal function new()\n    return M_class:new()\nend\n```\nYou can also see how some modules have variables being choosen by the user when creating a new object.\n```lua\nlocal function new(a, b)\n    local obj = M_class:new()\n    obj.a = a\n    obj.b = b\n\n    return obj\nend\n```\n### 4. Documenting\nHere i just use lua annotations of the default `lsp` *(language server)* to make using the modules easier and not needing former documentation in some host like `readthedocs`.\n```lua\n---@param a number Number \"a\"\n---@param b number Number \"b\"\n---@return number Sum\nfunction M.Add(a, b)\n    return a + b\nend\n```\nTo add documentation you need to make the `M` variable a class with annotations. If you are using a `new()` method, make it return the module's annotation class:\n```lua\n---@class Example\nlocal M = {}\nlocal class = require(\"modules.class\")\nlocal M_class = class(M)\n\n---@return Example\nlocal function new()\n    return M_class:new()\nend\n```\n### 5. Final steps\nAfter finishing the module, i check that the code is correct, look for spelling errors and all of that boring ~crap~.\\\n\\\nThen i add it to `lib.lua` and `README.md` ([README.md format](README.md#Modules))\n```lua\n-- lib.lua\n\u003cmodule_name\u003e = require(\"modules.\u003cmodule_name\u003e\")\n```\n\\\nAnd finally i just commit and push the changes to the repo.\n```bash\ngit add . # my alias: ga .\ngit commit -m 'Finished module \"\u003cmodule_name\u003e\"' # my alias: gcmsg \u003cmessage\u003e\ngit push origin main # my alias: ggpush\n```\n\n# Tests\nTo run tests:\n1. Replace the `test_path` variable with the path of the test you would like to run.\n2. Run `main.lua` with **love**.\n```bash\nlove .\n```\n\n# Links\n- Love2d forum post: https://love2d.org/forums/viewtopic.php?t=96218\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnykenik24%2Flove2d-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnykenik24%2Flove2d-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnykenik24%2Flove2d-tools/lists"}