Worlds are data
A game is one TypeScript object of rooms, items, people, events and the rules that join them. Write a story without touching engine code.
Three packages for classic parser games in a CRT terminal. Write your own world as data, mount it on a page, or load a Z-machine story file. The demo plays the Zork trilogy.
npm install @brass-lantern/engine @brass-lantern/vue vue pinia| Package | What it is |
|---|---|
@brass-lantern/engine | The game itself: parser, rules, saves and the Z-machine bridge. Runs anywhere, no DOM. |
@brass-lantern/vue | The CRT terminal, themes and mountGame, as a Vue 3 component. |
@brass-lantern/server | Optional. An Express route that lets players type like people, through Gemini. |
import { mountGame } from '@brass-lantern/vue';
import '@brass-lantern/vue/style.css';
import type { World } from '@brass-lantern/engine';
const world: World = {
startRoom: 'study',
rooms: {
study: {
name: 'The Study', description: 'A desk, a chair, and the dark.',
exits: {}, items: ['lantern'], npcs: [], onEnter: [],
},
},
items: {
lantern: { name: 'brass lantern', aliases: ['lamp'], description: 'Unlit, for now.', portable: true, tags: [] },
},
npcs: {}, events: {}, dialogue: {}, flagLabels: {},
};
mountGame('#app', {
cartridges: [{ kind: 'world', id: 'study', title: 'THE STUDY', world }],
storagePrefix: 'study',
});Then build a real one, or read Using the library for the component, themes and options.
Office Space: The Text Adventure is a full-length game on this engine: four chapters from a very bad Monday at Initech to a field, a baseball bat and a printer that has it coming. It runs with the intent server, so you can type like a person.