A code-first framework for building love2d games in typescrip utilizing the amazing typescript2lua.
Note: ancient-love is still a work-in-progress.
...may your games built with love last centuries.
These are the modules which are completed
- logging
- scene
- ECS
- timer
- signals
- Observables
- camera via Cam11
- tween via flux
- color
- GLSL shader syntax highlighting
- collision system
- debugger (this partially works)
- controller / input mapping
- advanced collisions
- curved geometries / lerp'd things
- UI
- Sound Mixer
- animations
- bones / splines
- Documentation
- Create a new empty directory for your game, and
cd
into it - Run
npm create ancient-love
in the new directory - Run
npm install
- Run
code -n .
to open a new VSCode window into the directory - Install the suggested extensions
- Configure your game by editing
game.json
andsrc/conf.ts
All together:
mkdir my_game_name
cd my_game_name
npm create ancient-love
npm install
code -n .
Use npm run dev
to watch for typescript file changes within src
.
it will output to the build
directory.
Use npm run build
to build your game, once.
You can run the game via npm run love
, or love ./build
.
There are VSCode tasks available by default for running your game.
You can use HMR via npm run hmr
.
Having one shell running npm run dev
and another running npm run hmr
could be a very good workflow!
Note: Hot module replacement mostly works but isn't perfect. Figure it functions by reloading changed lua files in your love game—so expect the idempotent-ness code of that file to determine how easily it can be re-ran.
Note that packaging is a script that automates the steps from love2d.org's Game Distribution page (with some pretty output). So, if you run into errors, want to understand it, or want to manually build—that's there for you.
-
Make sure your game is first built via
npm run build
. -
Make sure your
game.json
has the correct configuration (values forgame_name
, and theplatforms
you want to build for are filled-in) -
Run
npm run love:build
to build for your platforms listed ingame.json
- You can also pass specific overrides to this script:
npm run love:build -- game_version=alpha
to build a game with the version "alpha". - By default the version is the value of
game_version
ingame.json
, or the checksum of the./build
directory
- You can also pass specific overrides to this script:
-
Check
dist
for the related files to be distributed