Skip to content

Kaleidosium/Tsuki

Repository files navigation

Tsuki 🈷️

Tsuki is a project template to quickly set up LÖVE to run Yuescript instead of Lua, without precompiling your .yue files to .lua

This repository was forked from novafacing's selene.

Table of Contents

Installing

Tsuki works on Linux, macOS and Windows. It should also work anywhere else that LÖVE runs!

Install LÖVE

Tsuki needs LÖVE to be installed to run your game, and you can get the installer for your platform at the LÖVE website.

Create Your Game

You have two options when using Tsuki to create your game:

First (and most recommended) is to use this repo as a template repo. To do that, click the button at the top right of the github page that says "Use this template". That will create a new repo in your account that is a copy of the Tsuki repo!

Second, is you can directly clone and modify this repo (or a fork of it), or just download the zip file of this repo.

Once you have decided, just clone this repo (replace the link with your own if you forked or used it as a template):

git clone https://github.com/kaleidosium/tsuki.git

Using

First Run

Now that you have the repository set up, you will need a couple dependencies:

  • lua == 5.1: You can probably install from your package manager i.e. apt install lua5.1
  • luarocks: You can probably also install this from your package manager, or you can get it here
  • act: For local release builds, you will need to install act

Once you have luarocks installed, you can install the dependencies with:

luarocks make --dev

Don't forget the --dev, it's important! Finally, run love . to start your game! There is a demo project already configured for you, and you should see something like this:

A screenshot of the game running, displaying a moon image on the default LÖVE dark background

and you should be able to move around with the arrow keys.

Writing Your Game

Now that you're all set up, write your game! Your source code should go in the src directory, and you can add as many files as you want. The main file gives an example of how to require another file (in this case Game.yue) to make your game's code modular. There is also a Player class and a Vector2 class to demonstrate how you might make your game even more modular.

Testing

Testing

There is a build/test script build.yue provided that works automatically with the template repo. You can invoke it to run tests like:

yue -e build.yue src --test

It will run busted tests on all files matching a pattern, which defaults to Test.+%.yue but you can provide your own once you start writing your own tests like so:

yue -e build.yue src --test --pattern '.+Test%.yue'

Release Builds

Release builds of projects will contain the bare minimum files to run, so for release all .yue files will be compiled to .lua, all extra libraries are removed, and a .love or .exe is produced. You can produce a release build by running:

act --artifact-server-path=release

This will spin up a pipeline, build your release, and output the files to release.

Debugging Release Builds

The release build uses build.yue to compile all your .yue files to .lua. If you have an issue, you can invoke it locally:

yue -e build.yue src

This will display any build errors encountered.

You can clean up the lua files from the source tree with:

yue -e build.yue src --clean

But be aware this will delete all .lua files in src!

Useful Documentation

Contributions and Bug Fixes

Bug fixes and contributions are welcome! If you find any issues, just open an Issue and I'll take a look at it. I'm not going to formalize the process too much, because this is a tiny repo and I don't expect I'll add too much code to it. Any improvements are likewise appreciated!

Thanks

Thanks for using Tsuki! I hope it helps you create great games, and if you do, please open a PR to add a gif or screenshot of your game and a link to it to this README so you can show it off!

And special thanks to novafacing (The creator of Selene), pigpigyyy (The creator of Yuescript), leafo (The creator of MoonScript), and various other people who have contributed to the projects this one relies or built on. Without their contributions, this project would not have existed.

License

MIT