Clone this project recursively, because libraries are included as submodules:
git clone --recurse-submodules
# or
git clone --recurse-submodules --shallow-submodulesIf it's already cloned without, and you don't want to start over, they can be initialized with:
git submodule update --init
# or
git submodule update --init --depth 1To run the code, LÖVE2D is required. It's been tested and developed on version 11.5 (Mysterious Mysteries).
For unit tests, we are using the busted framework. Also, we need to supply a utf-8 library, one of which comes with LOVE, but is not available for Lua 5.1 / Luajit by default. Luafilesystem is used in some tests and utility scripts used for generating documentation.
The recommended way of installing these is with LuaRocks:
luarocks --local --lua-version 5.1 install busted
luarocks --local --lua-version 5.1 install luautf8
luarocks --local --lua-version 5.1 install luafilesystemFor information about installing LÖVE2D and LuaRocks, visit their respective webpages.
Hacking on this requires Node.js and NPM (or your node runtime and package manager of choice), to run love.js.
For automating tasks, we use just. For example, to set up the web version for development, you can run
just setup-web-devThe contents of this module will be put into the global
namespace (_G). However, the language server does not pick up
on this (yet), so usages will be littered with warnings unless
silenced.
Analogous to pcall(), require a lua file that may or may not
exist. Example:
--- @diagnostic disable-next-line undefined-global
local autotest = prequire('tests/autotest')
if autotest then
autotest(self)
endThe game can be run with a test subcommand, which causes it to
launch in test mode.
love src testlove src test --autoRun the autotest function on startup. This is optionally defined
in tests/autotest.lua with the following signature:
--- @param self ConsoleController
local function autotest(self)
--- commands here
end
return autotestlove src test --sizeThis is causes the terminal and the input field to be smaller (so overflows are clearly visible).
love src test --drawFor testing blend modes, draws several small canvases
(implies --size).
In project root:
busted testsCertain diagnostic key combinations are only available in debug
mode, to access this, run the project with the DEBUG
environment variable set (it's value doesn't matter, just that
it's set):
DEBUG=1 love srcIn this mode, a VT-100 terminal test can be activated with ^T (C-t, or Ctrl+t).
Similarly, to set double scaling, set the HIDPI variable to
true:
HIDPI=true love src