Skip to content

francisrstokes/gibson-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gibson Engine

A minimalist text game (interactive fiction) engine, inspired by the original Quest engine.

What is the Gibson engine?

It's an engine for creating text based games, or interactive fiction using javascript.

World format

Games are specified by passing the engine a 'world' object. A world consists of 3 properties:

const myWorld = {
  rooms: {},
  items: {},
  actors: {}
}

Rooms describe places in game, items describe interactable objects, and actors are NPC characters the player interacts with.

Room Object

A simple room object must have at least 3 properties:

  • description, which can be either a string or a function with the signature (state, world)
  • items, an array containing item references
  • actors, an array containing actor references
const room = {
  description: "You walk into a dark room.",
  items: [],
  actors: []
};

Additionally you can use the game engine hooks to specify extra behaviour:

  • onEnter(state, world)
  • onExit(state, world)

About

A minimalist text game (interactive fiction) engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published