A simple text adventure game engine for Sway/swaynag.
Deps are sway, jq, and coreutils (
sudo apk add coreutils jq on Alpine).
Run the shell script from anywhere to launch the game, which is defined by the JSON files in a pretty straightforward format.
Sections are named, without save data it starts in the section "start" in the file "main.json".
Sections are JSON objects. The message and detailed_message properties contain the messages to be shown (the detailed one is multiline, message should be a quick summary). The options property is an array of objects indicating buttons to be shown. The name property of options is the button's label, type is either label or file. If type is label, then the target property contains the name of another section in the same file to switch to as a string. If the type is file, then the target property contains a JSON file in the same format, and an additional property start contains the starting section in the new file
Swaygame autosaves every time you move (save data is just two lines for now, section and file). There's a button automatically shown that wipes the save data.
I'm going to add variables shortly (for e.g. HP/STR/etc).