Changed state fetch to return all states - allow client more control

This commit is contained in:
Jeremiah Billmann
2013-07-07 15:46:35 -04:00
parent 85458c47b9
commit 0380e63899
2 changed files with 21 additions and 23 deletions
+11 -2
View File
@@ -38,8 +38,17 @@ $(function () {
ctxCanvas.clearRect(0, 0, canvas.width, canvas.height);
GarageServerIO.getPlayerStates(function (state) {
ctxCanvas.fillRect(state.x, state.y, 15, 15);
GarageServerIO.getStates(function (selfState, playerStates, entityStates) {
playerStates.forEach(function (player) {
ctxCanvas.fillRect(player.currentState.x, player.currentState.y, 15, 15);
});
entityStates.forEach(function (entity) {
ctxCanvas.fillRect(entity.currentState.x, entity.currentState.y, 15, 15);
});
ctxCanvas.fillRect(selfState.x, selfState.y, 15, 15);
});
}
});