{"id":13337728,"url":"https://github.com/borbware/tic80-boilerplate","last_synced_at":"2025-03-11T07:30:49.424Z","repository":{"id":57764633,"uuid":"527047867","full_name":"borbware/tic80-boilerplate","owner":"borbware","description":"Boilerplate code for creating multi-file TIC-80 cartridges ","archived":false,"fork":false,"pushed_at":"2023-12-05T17:58:21.000Z","size":1640,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-12-05T18:52:58.845Z","etag":null,"topics":["lua","tic-80"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/borbware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-08-20T21:54:25.000Z","updated_at":"2023-11-01T00:52:51.000Z","dependencies_parsed_at":"2023-12-05T18:49:57.935Z","dependency_job_id":null,"html_url":"https://github.com/borbware/tic80-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borbware%2Ftic80-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borbware%2Ftic80-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borbware%2Ftic80-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borbware%2Ftic80-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borbware","download_url":"https://codeload.github.com/borbware/tic80-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213069710,"owners_count":15532844,"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":["lua","tic-80"],"created_at":"2024-07-29T19:14:56.299Z","updated_at":"2024-10-23T16:31:24.986Z","avatar_url":"https://github.com/borbware.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TIC-80 boilerplate\n\nThis is my TIC-80 boilerplate code for multi-file projects.\nDuring development, the project is separated into multiple .lua files, and they are combined into one for building an executable.\n\n## Environment setup\n\nI'm using Windows for development, so all the scripts included are for Windows. You might get the idea how to implement them for Linux/Mac by looking at them, though.\n\n### Requirements:\n\n* Windows PC\n* TIC-80 pro\n  * Add installation directory to PATH environmental variable\n* WSL2 on Windows\n  * luarocks\n  * luacc on luarocks\n\n### Good-to-haves:\n\n* Visual Studio Code\n* [Lua Language Server](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) Extension for Visual Studio Code\n* [Lua Extension](https://marketplace.visualstudio.com/items?itemName=keyring.Lua) for Visual Studio Code\n\n### Instructions\n\nYou need TIC-80 pro to get support for .lua cartridges - WSL is used for running luarocks (I've noticed running luarocks on WSL is less error-prone than on Windows)\n\n\nIn WSL, install [luarocks](https://luarocks.org/):\n\n```\nsudo apt-get install luarocks\n```\nand then install [luacc](https://github.com/mihacooper/luacc) that is used to combine the lua files.\n\n```\nsudo luarocks install luacc\n```\n\nLuacc isn't perfect (you need to supply it with a list of files to combine), so I might change to another system later.\n\n## TIC-80 setup\n\n### Lua path\n\nTo get `require` statement working, I've had to explicitly add the project folder to Lua's `package.path` variable. This happens on line 10 of `main.lua` - change the path `Q:/github/tic80-boilerplate/` to your project folder. \n\nNote that this is only needed if you get the error `module 'libs/math' not found` when running the game; if said error never appears, you can just remove the line.\n\n### Adding more files\n\nWhen you add a new file:\n* Add a new require statement for it in `main.lua`\n* Add the file to `luacc.sh` so the built executable works as well (see [Building an executable](#building-an-executable) below).\n\n## Running\n\nRun `runtic80.bat` in the command line. It runs `main.lua` on TIC-80 from the command line.\n\nThe savefiles are located under the project folder in the `.local` directory.\n\n## Building an executable\n\nTo create a Windows build, run `buildWin.bat \u003cversion\u003e` (e.g., `buildWin.bat 1.0`). \n\nBy running the `luacc.sh` script, it creates a `game.lua` file - a bundle that contains all the code files in one.\n\nThen, it creates a new `TIC-80-boilerplate-\u003cversion\u003e.exe` file in the `/build/` folder.\n\n***Note:*** You can set the name of the game to something else in the buildWin.bat file.\n\n***Note 2:*** Tos create Mac and Linux builds, run the `buildAll.bat \u003cversion\u003e` script instead!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborbware%2Ftic80-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborbware%2Ftic80-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborbware%2Ftic80-boilerplate/lists"}