This commit is contained in:
Jeremiah Billmann
2013-07-14 11:16:43 -04:00
parent 2e714b80ce
commit 710f33a753
4 changed files with 27 additions and 7 deletions
+7 -1
View File
@@ -26,10 +26,16 @@ Game.prototype.start = function () {
Game.prototype.update = function () {
var players = this.server.getPlayers(),
entities = this.server.getEntities(),
self = this;
players.forEach(function (player) {
var newState = gamePhysics.getNewState(player.state, player.inputs, self.physicsDelta);
var newState = gamePhysics.getNewPlayerState(player.state, player.inputs, self.physicsDelta);
self.server.updatePlayerState(player.id, newState);
});
entities.forEach(function (entity) {
var newState = gamePhysics.getNewPlayerState(entity.state, self.physicsDelta);
self.server.updateEntityState(entity.id, newState);
});
};