npm i # setup
npm start # dev server
npm run build # make build
npm run optimize-images # optimize image assets (slow)
- Bump the package version (
npm version patch/minor/major
) - Push changes
- Go to release action
- Select "Run workflow", and confirm on
main
branch
The workflow will automatically create a build and upload it to itch.io.
./src/assets/cards.txt
: card definitions + scene cheat sheet./src/assets/obstacles.txt
: obstacle definitions./src/assets/levels.txt
: level generation./src/assets.txt
: list of files to load
These are all loaded dynamically at runtime, so you can take a single build and edit them + reload instead of using the dev server.
cards
, obstacles
, and levels
are named .txt
for annoying build reasons but are actually JS and indirectly eval
d by the game.
- if there are no obstacles:
- moves to next area
- if there is an obstacle, and the obstacle has a
start
, trigger thestart
- if there is an obstacle:
- if the obstacle has health, deal damage to obstacle
- if the obstacle died:
- queue death animation
- if the obstacle has an
end
, trigger theend
- if the obstacle died:
- if the obstacle has an
interact
, trigger theinteract
- if the obstacle has damage, deal damage to front
- if the obstacle has health, deal damage to obstacle
Note that because of how interact
, end
, and the action queue work, if an obstacle dies during Advance
the order will be:
damage >
interact
> death animation >end
To avoid triggering interact
during the turn an obstacle dies, add if (!this.health) return;
to the top of the function.
- All interaction is player-driven: enemies don't attack, they just react to the player's
Advance
. end
will also be triggered when an obstacle is killed through cards or as a result of anotherinteract
.- Armour: each point of armour blocks a single hit (regardless of damage)
- Obstacles without starting health will never die as a result of damage: they need to be killed via
killObstacle
in theirinteract