Refactoring client side prediction for players to make for consistent API calls with client side prediction for entities (#20)

This commit is contained in:
Jeremiah Billmann
2015-05-20 00:59:05 +00:00
parent bd341f5f0c
commit e96adda2c2
4 changed files with 31 additions and 16 deletions
+3 -1
View File
@@ -10,7 +10,9 @@ $(function () {
GarageServerIO.initializeGarageServer('', {
logging: true,
onReady: startGame,
onUpdatePlayerPrediction: GamePhysics.getNewPlayerState,
onUpdateClientPredictionReady: function(playerId, playerCurrentState, inputs, deltaTime) {
GarageServerIO.updatePlayerState(playerId, GamePhysics.getNewPlayerState(playerCurrentState, inputs, deltaTime));
},
onInterpolation: GamePhysics.getInterpolatedState
});