TBQ: Text Based Quest games engine
Create a data file (e.g. data.json
), you can find format explanations in corresponding file. Then use the engine:
const TBQ = ;const game = TBQ; do var playerInput = /* Somehow get player input */ var actionResult = game; /* Output actionResult.text to player */ while !actionResultend
Each game.exec(playerInput)
call returns { text, end }
object (text
property is null
if command is invalid in given circumstances).
License
MIT