A framework for telling interactive stories, based on specific design principles:
For the readers/players:
For authors:
See https://github.com/jschomay/elm-interactive-story-starter.git for everything you need to get started, including an example story you can modify with your own content.
Step 1: Define your "story elements" (items, locations, and characters)
type MyItem
= Umbrella
...
items : MyItem -> ItemInfo
items item =
case item of
Umbrella ->
itemInfo "Umbrella" "Your trusty umbrella, you bring it everywhere with you."
...Step 2: Define your declarative "story rules," broken up into "scenes"
scene1rules =
[ interactingWith (item Umbrella)
`when` (unless (withItem Umbrella))
`changesWorld` [ addInventory Umbrella ]
`narrates` takingUmbrella
, interactingWith (item Umbrella)
`when` (inLocation Swamp)
`changesWorld` [ ]
`narrates` startingToRain
...
]
takingUmbrella =
"Never leave home without it."
startingToRain =
"Good thing your brought your umbrella..."Step 3: Load your story elements and rules into the framework
Story.load info elements scenes setup