ThePix / QuestJS

A major re-write of Quest that is written in JavaScript and will run in the browser.
MIT License
75 stars 15 forks source link
games javascript quest

This is a full re-write of Quest, an interactive fiction app, to pure JavaScript. An example game that was entered for IFcomp 2021 can be found here.

A Successor to Quest 5

Quest 5 is written in C#, with some Visual Basic, has its own scripting language, ASL, and also uses JavaScript for the UI. Players can either download a dedicated player/editor or use the web version, in the latter case the game runs on the textadventures.co.uk server. In contrast, Quest 6 is written entirely JavaScript, and runs in the player's browser. This means:

Better for players

Better for authors

Better for me

Alex had some experiments into this before he quit. QuestJS was hoped to convert a Quest .quest file to pure JavaScript. QuestKit was supposed to do pretty much the same as I am doing here. Arguably Squiffy is another attempt, being entirely JavaScript, though without a parser.

Is there an editor?

No, but it is under development. It is in another repository here, so go there to learn more on how that is going.

However, you do not need a dedicated editor to create games, and the Wiki includes a tutorial that will take you through how you can already create a game.

Will it be possible to convert existing Quest games?

Yes, but it is not perfect - see here.

What does QuestJS code look like?

This is what the code for QuestJS looks like. It creates a player, two rooms and a hat.

createItem("me", PLAYER(), { 
  loc:"lounge",
  regex:/^(me|myself|player)$/,
  examine:'Just a regular guy',
})

createRoom("lounge", {
  desc:'A small room with an old settee and a tv.',
  east:new Exit('kitchen'),
})

createRoom("kitchen", {
  desc:"The kitchen looks clean and well-equipped.",
  afterFirstEnter:function() {
    msg("You can smell freshly baked bread!")
  },
  west:new Exit("lounge"),
})

createItem("hat", WEARABLE(), {
  examine:"It is straw boater, somewhat the worse for wear.",
  loc:"lounge",
})

What do QuestJS games look like?

Here are some examples:

Where do I learn more?

Take a look at the Wiki to see the full documentation. You will find a tutorial that will explain everything from what you need to download, to how to publish your new game.