Used world state for heigh/width

This commit is contained in:
Jeremiah Billmann
2013-07-14 10:57:18 -04:00
parent 08869d878e
commit 2e714b80ce
4 changed files with 10 additions and 6 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ options = {
onPlayerUpdate: function (state),
onEntityUpdate: function (state),
onPlayerRemove: function (id),
onGameState: function (state),
onWorldState: function (state),
onPing: function (pingDelay),
onUpdatePlayerPhysics: function (state, inputs, deltaTime),
onInterpolation: function(previousState, targetState, amount)
@@ -175,8 +175,8 @@ var GarageServerIO = (function (socketio) {
}
});
_socket.on('state', function (data) {
if (_options.onGameState) {
_options.onGameState(data);
if (_options.onWorldState) {
_options.onWorldState(data.worldState);
}
_stateController.physicsDelta = data.physicsDelta;
_stateController.interpolation = data.interpolation;