mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-07-05 17:30:44 +08:00
Furthered GarageServer.IO API calls to support client side prediction for entities - #20 - still have to change how client side prediction is invoked/processed.
This commit is contained in:
@@ -10,8 +10,11 @@ $(function () {
|
||||
GarageServerIO.initializeGarageServer('', {
|
||||
logging: true,
|
||||
onReady: startGame,
|
||||
onUpdateClientPredictionReady: function(playerId, playerCurrentState, entityCurrentStates, inputs, deltaTime) {
|
||||
GarageServerIO.updatePlayerState(playerId, GamePhysics.getNewPlayerState(playerId, playerCurrentState, inputs, deltaTime));
|
||||
onUpdateClientPredictionReady: function (playerId, playerCurrentState, entityCurrentStates, inputs, deltaTime) {
|
||||
entityCurrentStates.forEach(function (entity) {
|
||||
GarageServerIO.updateEntityState(entity.id, GamePhysics.getNewEntityState(entity.state, deltaTime));
|
||||
});
|
||||
GarageServerIO.updatePlayerState(playerId, GamePhysics.getNewPlayerState(playerId, playerCurrentState, inputs, deltaTime, GarageServerIO));
|
||||
},
|
||||
onInterpolation: GamePhysics.getInterpolatedState
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user