Documentation formatting & typos

This commit is contained in:
Jeremiah Billmann
2013-07-24 18:09:24 -04:00
parent 4e4813bb20
commit ceb8df80e6
+7 -5
View File
@@ -29,8 +29,8 @@ var server = garageServer.createGarageServer(sockets,
server.start(); server.start();
// Inside physics loop, process inputs for players, process entites and update state // Inside physics loop, process inputs for players, process entites and update state
var players = server.getPlayers(), var players = server.getPlayers(),
entities = server.getEntities(), entities = server.getEntities(),
players.forEach(function (player) { players.forEach(function (player) {
// Calculate new state from player.state and player.inputs // Calculate new state from player.state and player.inputs
@@ -55,7 +55,7 @@ GarageServerIO.initializeGarageServer('http://insertmygameurlhere.com', {
}, },
onInterpolation: function (previousState, targetState, amount) { onInterpolation: function (previousState, targetState, amount) {
// If interpolating, return new state // If interpolating, return new state
}, },
onWorldState: function (state) { onWorldState: function (state) {
// Extract world state sent from server // Extract world state sent from server
} }
@@ -82,7 +82,7 @@ GarageServerIO.addInput(myInput);
```js ```js
GarageServerIO.initializeGarageServer(path, options) GarageServerIO.initializeGarageServer(path, options)
/*
options = { options = {
onPlayerConnect(callback), onPlayerConnect(callback),
onPlayerDisconnect(callback), onPlayerDisconnect(callback),
@@ -99,6 +99,7 @@ options = {
onReady(callback), onReady(callback),
logging: true logging: true
} }
*/
``` ```
```js ```js
@@ -121,7 +122,7 @@ GarageServerIO.sendServerEvent(data)
```js ```js
require('garageserver.io').createGarageServer(io, options) : GarageServerIO require('garageserver.io').createGarageServer(io, options) : GarageServerIO
/*
options = { options = {
stateInterval: 45, stateInterval: 45,
logging: true, logging: true,
@@ -139,6 +140,7 @@ options = {
onPing(callback(socket, data)), onPing(callback(socket, data)),
onEvent(callback(data)) onEvent(callback(data))
} }
*/
``` ```
```js ```js