This commit is contained in:
Jeremiah Billmann
2013-07-06 14:21:11 -04:00
parent a366576031
commit 8290aa31fa
6 changed files with 42 additions and 7 deletions
+3 -2
View File
@@ -49,5 +49,6 @@ garageServer.createGarageServer(sockets,{
logging: true,
interpolation: true,
clientSidePrediction: true,
onUpdatePlayerPhysics: gamePhysics.onUpdatePlayerPhysics
});
onUpdatePlayerPhysics: gamePhysics.onUpdatePlayerPhysics,
onUpdateEntityPhysics: gamePhysics.onUpdateEntityPhysics
});
+9 -1
View File
@@ -3,7 +3,7 @@
exports.onUpdatePlayerPhysics = function (id, state, inputs, deltaTime) {
var i = 0;
if (!state.x && !state.y) {
if (!state.x && !state.y) {
state.x = 0;
state.y = 0;
}
@@ -20,5 +20,13 @@
}
return state;
};
exports.onUpdateEntityPhysics = function (id, state, deltaTime) {
if (!state.x && !state.y) {
state.x = 0;
state.y = 0;
}
state.x += (10 * deltaTime);
};
})(typeof exports === 'undefined' ? window : exports);