tbq

0.2.0 • Public • Published

TBQ: Text Based Quest games engine

Build Status Dependency Status

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

Package Sidebar

Install

npm i tbq

Weekly Downloads

1

Version

0.2.0

License

MIT

Last publish

Collaborators

  • vandamm