Try it out
The best way to try out this project is to run a Node server that serves the static content. With Node.js installed, do this:
$ git clone https://github.com/bandaloo/afterlight-caves $ cd afterlight-caves $ npm install $ npm start
Then point your favorite browser to
http://localhost:4000 to try it out.
We use no front-end dependencies, everything in the
static directory can be
they've been in the standard for a long time now.
We also use the Prettier code formatter to simplify code style decisions.
Build a production version
$ npm run build
This uses Babel to transpile our scripts to ES5, then
bundles them with Browserify and writes the output to
dist directory. You can tell the server to serve files from the
directory instead of
static by doing this:
$ node index.js --compat
If you want to run the score server on a different domain from the static site
content, just set the
build-prod.js, and score requests will be made to the custom score server
URL in the production version.
start-compat npm script builds and serves from the
$ npm run start-compat
If you just want to run the game on your desktop as a standalone application, download a build for your operating system on the releases page.
To build a desktop version yourself, the following script will make a build for
all support operating systems in the
$ npm run package-desktop
You can also package an RPM file for RedHat-compatible systems like Fedora, CentOS, and OpenSUSE:
$ npm run package-rpm
To run the desktop application without building an executable, do this:
$ npm run build-electron $ npm run start-electron
We use Mocha and Chai in the browser to run tests with ES6 modules. This was set up with the help of this article.
The easiest way to run the tests is to launch a local server and open
tests.html in your browser.
- "cavedive" by Mason Granof