From 62c03e8f8655bed3178e9f5eaec1ab709270d0a4 Mon Sep 17 00:00:00 2001 From: Jeremiah Billmann Date: Sun, 28 Jul 2013 12:21:24 -0400 Subject: [PATCH] Progress: Documentation --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0d240e5..f3ae4f0 100644 --- a/README.md +++ b/README.md @@ -27,11 +27,11 @@ var server = garageServer.createGarageServer(sockets, worldState: { width: '400px', height: '400px'; } }); ``` -**2.** Start GarageServer.IO instance prior to starting physics loop +**2.** Start GarageServer.IO instance prior to starting physics loop. This starts the clock that is used for broadcasting state. ```js server.start(); ``` -**3.** Inside physics loop, process inputs for players, process entites and update states +**3.** Inside physics loop, process inputs for players, process entites and update states. Note that state is an object literal effectively offering up any grab bag of properties that pertain to your game's state. ```js var players = server.getPlayers(), entities = server.getEntities(); @@ -58,7 +58,7 @@ entities.forEach(function (entity) { ### Client -**1.** Initialize GarageServer.IO +**1.** Initialize GarageServer.IO. ```js GarageServerIO.initializeGarageServer('http://insertmygameurlhere.com', { onReady: function () { @@ -87,11 +87,11 @@ GarageServerIO.initializeGarageServer('http://insertmygameurlhere.com', { } }; ``` -**2.** Inside physics loop, capture and send input via GarageServer.IO +**2.** Inside physics loop, capture and send input via GarageServer.IO. ```js GarageServerIO.addInput(myInput); ``` -**3.** Inside render loop, extract player and entity states +**3.** Inside render loop, extract player and entity states. ```js var playerStates = GarageServerIO.getPlayerStates(), entityStates = GarageServerIO.getEntityStates();