erkyrath / quixe

A Glulx VM interpreter written in Javascript
http://eblong.com/zarf/glulx/
MIT License
169 stars 33 forks source link

Quixe -- a Glulx VM interpreter written in Javascript

Quixe Library: version 2.2.4. Designed by Andrew Plotkin erkyrath@eblong.com. (Storage and heap-management code contributed by Iain Merrick.) http://eblong.com/zarf/glulx/quixe/

Quixe is a pure-Javascript interpreter for the Glulx IF virtual machine. It can play any Glulx game file (.ulx or .gblorb) in a web browser. It does not require a server component; it runs entirely in the browser.

Quixe currently supports text buffer and grid windows, character and line input, timers, and hyperlinks. Experimental graphics support has just been added. It does not (yet) support sound or style hints.

You can save and restore games. If your browser supports the HTML5 local-storage feature, the save files will be available from one browser session to the next.

The easiest way to use Quixe is to have Inform 7 build you a game-playing page. Download the "Quixe.zip" template package (at the URL above), unpack it, and install it into Inform's template directory. (On a Mac this is ~/Library/Inform/Templates; place the unzipped Quixe folder there.) You can then add this line to your Inform source code:

Release along with the "Quixe" interpreter.

You can also copy the files right out of this project. The play.html file is set up to run Glulxercise, which is not actually an IF game, but uses the same format. (Glulxercise is a set of unit tests for Quixe.)

You can copy play.html and all the files it uses. However, play.html as provided cannot load Glulx files directly. You must convert your game file using the game2js.py script in the tools directory:

python tools/game2js.py --giload mystory.ulx > mystory.ulx.js

Then, in play.html, replace the reference to "glulxercise.ulx.js" with your "mystory.ulx.js" file.

To set up a page that can play any game file on the Internet (as on the web site), copy play-remote.html.

The included version of GlkOte has extra support for the Electron environment. This is a version of Node.js wrapped up as an application shell, with extra APIs for native file support. In this environment, use lib/elkote.min.js instead of lib/glkote.min.js.

If you have no idea what I just said, ignore lib/elkote.min.js.