mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-06-27 16:10:34 +08:00
Progress #3
This commit is contained in:
+3
-2
@@ -49,5 +49,6 @@ garageServer.createGarageServer(sockets,{
|
||||
logging: true,
|
||||
interpolation: true,
|
||||
clientSidePrediction: true,
|
||||
onUpdatePlayerPhysics: gamePhysics.onUpdatePlayerPhysics
|
||||
});
|
||||
onUpdatePlayerPhysics: gamePhysics.onUpdatePlayerPhysics,
|
||||
onUpdateEntityPhysics: gamePhysics.onUpdateEntityPhysics
|
||||
});
|
||||
@@ -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);
|
||||
Reference in New Issue
Block a user