diff --git a/example/shared/core.js b/example/shared/core.js index eb80987..6b0c05c 100644 --- a/example/shared/core.js +++ b/example/shared/core.js @@ -22,11 +22,11 @@ } return state; }; - + exports.getNewEntityState = function (state, deltaTime) { }; - + exports.getInterpolatedState = function (previousState, targetState, amount) { var interpolationState = {}; interpolationState.x = (previousState.x + amount * (targetState.x - previousState.x)); @@ -34,4 +34,12 @@ return interpolationState; }; + function s4() { + return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); + } + + function guid() { + return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); + } + })(typeof exports === 'undefined' ? window.GamePhysics = {} : exports); \ No newline at end of file diff --git a/lib/server/garageserver.io.js b/lib/server/garageserver.io.js index 7bad2dc..37e54a1 100644 --- a/lib/server/garageserver.io.js +++ b/lib/server/garageserver.io.js @@ -133,7 +133,7 @@ GarageServer.prototype.removeEntity = function (id) { }; GarageServer.prototype.updateEntityState = function (id, state) { - + this.game.updateEntityState(id, state); }; GarageServer.prototype.getEntities = function () {