npm promotes metadefinitions
    Have ideas to improve npm?Join in the discussion! »

    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

    Install

    npm i tbq

    DownloadsWeekly Downloads

    7

    Version

    0.2.0

    License

    MIT

    Last publish

    Collaborators

    • avatar