tbq
v0.2.0
Published
Text Based Quest games engine for node
Downloads
16
Readme
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 = require('tbq');
const game = TBQ.createGame(require('data.json'));
do {
var playerInput = /* Somehow get player input */
var actionResult = game.exec(playerInput);
/* Output actionResult.text to player */
} while (!actionResult.end)
Each game.exec(playerInput)
call returns { text, end }
object (text
property is null
if command is invalid in given circumstances).
License
MIT