mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-09-09 11:14:19 +08:00
Progress #3
This commit is contained in:
+10
-2
@@ -22,11 +22,11 @@
|
|||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.getNewEntityState = function (state, deltaTime) {
|
exports.getNewEntityState = function (state, deltaTime) {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.getInterpolatedState = function (previousState, targetState, amount) {
|
exports.getInterpolatedState = function (previousState, targetState, amount) {
|
||||||
var interpolationState = {};
|
var interpolationState = {};
|
||||||
interpolationState.x = (previousState.x + amount * (targetState.x - previousState.x));
|
interpolationState.x = (previousState.x + amount * (targetState.x - previousState.x));
|
||||||
@@ -34,4 +34,12 @@
|
|||||||
return interpolationState;
|
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);
|
})(typeof exports === 'undefined' ? window.GamePhysics = {} : exports);
|
||||||
@@ -133,7 +133,7 @@ GarageServer.prototype.removeEntity = function (id) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
GarageServer.prototype.updateEntityState = function (id, state) {
|
GarageServer.prototype.updateEntityState = function (id, state) {
|
||||||
|
this.game.updateEntityState(id, state);
|
||||||
};
|
};
|
||||||
|
|
||||||
GarageServer.prototype.getEntities = function () {
|
GarageServer.prototype.getEntities = function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user