elm-package.json
file at this tag.Tag | 6.0.1 |
Committed At | 2021-02-14 17:58:53 UTC |
A tool for building interactive story games.
worldModel =
parseWorldModel
[ entity "PLAYER.fear=1"
, entity "TORCH.item.illumination=7.current_location=PLAYER"
, entity "CAVE.location.dark"
-- etc...
]
rules =
parseRules
[ rule "entering dark places"
"""
ON: *.location.dark
"""
"It's too dark to go in there!"
, rule "entering the cave with a light source"
"""
ON: CAVE
IF: *.item.illumination>5.current_location=PLAYER
DO: PLAYER.current_location=CAVE.fear+2
"""
"You enter the cave, {PLAYER.fear>4? your heart pounding | bravely}..."
-- etc...
]
Try it out in a live sandbox at https://ellie-app.com/7QdZzstKG6Fa1.
You can also clone https://github.com/jschomay/elm-interactive-story-starter to play with it locally.
Additional features:
The engine has two main parts: the world model, and the rules. You can use the authoring syntax shown above to define both of these.
From there, you can query the world model as needed to build your view, and you can find the best matching rule when a player interacts with an entity given the current state of the world, to update the world and show side effects like story text.
See the example link above for more context.
Read the dev blog