Update README.md

This commit is contained in:
jbillmann
2013-07-22 17:51:44 -05:00
parent bd58ae5d4a
commit 1463cacfa6
+36
View File
@@ -21,6 +21,42 @@ A simple, lightweight, HTML multiplayer game server (and client) for Node.js
### Client
```js
GarageServerIO.initializeGarageServer(path, options)
options = {
onPlayerConnect(callback),
onPlayerDisconnect(callback),
onPlayerReconnect(callback),
onPlayerUpdate(callback(state)),
onEntityUpdate(callback(state)),
onPlayerRemove(callback(id)),
onEntityRemove(callback(id)),
onEvent(callback(data)),
onWorldState(callback(state)),
onPing(callback(pingDelay)),
onUpdatePlayerPhysics(callback(state, inputs, deltaTime)),
onInterpolation(callback(previousState, targetState, amount)),
onReady(callback,
logging: true
}
```
```js
GarageServerIO.addInput(input)
```
```js
GarageServerIO.getStates(callback(playerStates: [player1State, player2State, ...], entityStates: [entity1State, entity2State, ...]))
```
```js
GarageServerIO.getId() : 'playerid'
```
```js
GarageServerIO.sendServerEvent(data)
```
### Server