Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
Document featuring example games made in Adventurejs. examples

How to Play Text Games

A Guide for the Uninitiated

Text adventures games, also referred to as interactive fiction, are an old form of game dating back almost to the beginning of personal computing. They're like stories where you are the main character, which only advance when you tell them what you want to do next. The way that you tell them what you want to do is by typing plain English sentences. Early games could only understand one or two words, like "take lantern" or "go east". Later games could parse more complicated sentences, like "take the lantern and then shine it on the crypt". But underneath, this kind of parser is really quite dumb; it's only pretending to understand what you tell it. In fact, it only recognizes a few words in certain combinations. When it finds phrases it recognizes, it returns pre-programmed responses. Though a good game will try to be flexible in its understanding, part of the job of playing is learning to give the game input that it can understand.

The game presented here will try to step you through the basics of telling the game what you'd like to do. We've also included the game's source code in case you'd like to see how it was made. Right-click here and select Save Link As to download a copy of the source file.

var MyGame = new adventurejs.Game( "MyGame", "MyGameDisplay" ).set({
  title: "How to Play Text Games",
  author: "Clippy",
  description: "The main character is YOU!",
  version: "0.0.1",
});

MyGame.createAsset({
  class: "Player",
  name: "Hero",
  is: { active: true, },
});

// dungeon antechamber
MyGame.createAsset({
  class: "Room",
  name: "Classroom",
  description: "",
  exits: 
  {
    // north: "Central Chamber",
  },
});