jocly/README.md

74 lines
3.3 KiB
Markdown
Raw Normal View History

2017-03-29 17:30:37 +02:00
Jocly is a library and set of tools to integrate boards games into Web environments.
It comes with a large collection of abstract strategy games, 2D and 3D user interface,
artificial intelligence to play against.
Demos
-----
2017-04-07 01:29:15 +02:00
[Controlled interface](https://mi-g.github.io/jocly/examples/browser/control.html) for playing Chess.
Click _**Other Jocly games**_ to switch to other games.
2017-03-29 17:30:37 +02:00
2017-04-07 01:29:15 +02:00
Simple human vs computer: [Classic chess](https://mi-g.github.com/jocly/examples/browser/simple.html?classic-chess),
2017-03-29 17:30:37 +02:00
[Circular chess](https://mi-g.github.com/jocly/examples/browser/simple.html?circular-chess),
[Multi layers chess](https://mi-g.github.com/jocly/examples/browser/simple.html?raumschach),
[Hexagonal chess](https://mi-g.github.com/jocly/examples/browser/simple.html?glinski-chess),
[Chinese chess](https://mi-g.github.com/jocly/examples/browser/simple.html?xiangqi),
[Middle-age chess](https://mi-g.github.com/jocly/examples/browser/simple.html?courier-chess),
[Scrum](https://mi-g.github.com/jocly/examples/browser/simple.html?scrum)
Or see and try [all available games](https://mi-g.github.com/jocly/examples/browser/multiple.html)
2017-04-30 11:47:15 +02:00
[JoclyBoard](https://github.com/mi-g/joclyboard) is a multi-platform desktop application based on Jocly
and [Electron](https://electron.atom.io/).
2017-04-30 18:22:01 +02:00
Install
-------
````
npm install jocly
````
2017-03-29 17:30:37 +02:00
Using Jocly in a Web page
-------------------------
Insert this line to your HTML source code:
````
2017-04-30 18:22:01 +02:00
<script src="node_modules/jocly/dist/browser/jocly.js"></script>
2017-03-29 17:30:37 +02:00
````
You are now ready to use the Jocly API through the `Jocly` global object.
2017-04-05 00:48:30 +02:00
Using Jocly in a node.js application
------------------------------------
````Javascript
const Jocly = require("jocly");
````
You are now ready to use the Jocly API through the `Jocly` entry point.
2017-04-30 18:22:01 +02:00
Building
--------
- install the *node.js* environment (using [nvm](https://github.com/creationix/nvm) is probably a good idea)
- install *gulp*: `npm install -g gulp`
- install [git](https://git-scm.com/downloads)
- clone Jocly from *github*: `git clone https://github.com/mi-g/jocly.git`
- enter the `jocly` directory
- download required modules: `npm install`
- build: `gulp build`
- `dist/browser` contains the javascript library to build web applications, `dist/node` is the module to be used for node.js applications
Notes:
- using `gulp build watch` instead of `gulp build` makes *gulp* start watching files after the build. Whenever a file is changed, a build is automatically generated
- you can use `--no-default-games` to prevent including the game modules from directory, and `--modules <colon-separated-directories>` to specify additional game modules to include. For instance, `gulp --no-default-games --modules src/games/chessbase:src/games/checkers build` will only generate distribution for Chess and checkers games
2017-05-11 11:37:22 +02:00
- you can specify the games to be built in the distribution with the `--games` option. For instance, `gulp --no-default-games --modules src/games --games xiangqi:classic-chess build` only generates Jocly for Classic Chess and XiangQi
2017-05-11 11:42:52 +02:00
- using the `no-obsolete` option filters out the games marked as obsolete
2017-03-29 17:30:37 +02:00
API Documentation
-----------------
2017-04-05 00:48:30 +02:00
Jocly offers two distinct APIs:
- the [Application API](https://github.com/mi-g/jocly/wiki/Application-API) to make Web applications
- the [Game API](https://github.com/mi-g/jocly/wiki/Game-API) to create games to run with Jocly features