-
Notifications
You must be signed in to change notification settings - Fork 0
GettingStarted
Cloak is a library for writing networked HTML5 games using Node.js. By "networked" I mean they are either server-validated single-player games, or they are multiplayer games. Cloak provides a variety of systems that are useful for networked games, such as:
- Automatic user identification and reconnection
- Lobby system
- Room system
- Chat
Your game will have a client and a server. The client is a HTML5 and JavaScript web application. It can have its own backend, or it can be served as static files by a standard web server such as Apache or Nginx. The client will use the Cloak client library. The server is a Node.js application. The server will use the Cloak server library.
If you are familiar with Socket.io this may look familiar. You can think of Cloak as a game-specific version of Socket.io with extra sugar. It currently uses Socket.io as a dependency, but in the future we plan on allowing Cloak to use other network libraries or stand alone.
To start making a game using Cloak, make sure you have the following software already installed:
First, create a directory for your server and add package.json and server.js files. A good starting package.json looks like this:
{
name: 'My Cool Game'
}
Before writing your server code, install the Cloak NPM module. Actually, you can't do this yet! But once you can, you will type npm install cloak --save. The --save flag will add it to your package.json as a dependency. Later on you can use npm install to install all dependencies listed in the package.json.
Now you can create your server.js. Use this as a starting point:
var cloak = require('cloak');
cloak.configure({
port: 8090
});
cloak.run();
[TODO]
All documentation on this wiki is licensed under a Creative Commons Attribution 3.0 Unported License. To attribute simply link to this wiki.
