Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
// NPC.js
(function () {
  /*global adventurejs A*/
  "use strict";

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Tangible.Character.NPC
   * @augments adventurejs.Character
   * @class adventurejs.NPC
   * @ajsnavheading CharacterClasses
   * @param {String} game_name The name of the top level game object.
   * @param {String} name A name for the object, to be serialized and used as ID.
   * @summary For non-player characters.
   * @todo AI, movement, conversation.
   * @tutorial Characters_NPCs
   * @todo more methods, better example
   * @classdesc
   * <p>
   * <strong>NPC</strong> is a subclass of
   * {@link adventurejs.Character|Character} and the base class
   * for all non-player characters.
   * </p>
   * <h3 class="examples">Example:</h3>
   * <pre class="display"><code class="language-javascript">MyGame.createAsset({
   *   "class": "NPC",
   *   "name": "Floyd",
   *   "synonyms": ["robot"],
   *   "place":{ in: "Utility Closet" },
   * })
   * </code></pre>
   **/
  class NPC extends adventurejs.Character {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "NPC";
    }
  }
  adventurejs.NPC = NPC;
})();