~pixelherodev/swaygame

None
967546a4 — Noam Preil 8 months ago
So I've had this lying around for literally years I think. Whoops.
First commit

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~pixelherodev/swaygame
read/write
git@git.sr.ht:~pixelherodev/swaygame

You can also use your local clone with git send-email.

#Swaygame

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).