mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-08-12 11:40:29 +08:00
Progress: Delta time & fixed timestep
This commit is contained in:
@@ -16,7 +16,6 @@ options = {
|
||||
|
||||
function GarageServer (socketio, options) {
|
||||
this.io = socketio;
|
||||
this.physicsDelta = (options.physicsInterval ? options.physicsInterval : 15) / 1000;
|
||||
this.game = new garageServerGame.createGame(options);
|
||||
this.registerSocketEvents(options);
|
||||
}
|
||||
@@ -28,7 +27,7 @@ GarageServer.prototype.registerSocketEvents = function (options) {
|
||||
if (options.logging) {
|
||||
console.log('garageserver.io:: socket ' + socket.id + ' connection');
|
||||
}
|
||||
socket.emit('state', { physicsDelta: self.physicsDelta });
|
||||
socket.emit('state', { physicsDelta: (options.physicsInterval ? options.physicsInterval : 15) / 1000 });
|
||||
self.onPlayerConnect(socket, options);
|
||||
|
||||
socket.on('disconnect', function () {
|
||||
|
||||
Reference in New Issue
Block a user