Fix lag; Camille forgot usleep(500)
This commit is contained in:
@ -73,13 +73,10 @@ class Game
|
|||||||
if (this._socket === undefined)
|
if (this._socket === undefined)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const loop_id = setInterval(() => {
|
|
||||||
if (this._socket.readyState === WebSocket.OPEN)
|
if (this._socket.readyState === WebSocket.OPEN)
|
||||||
{
|
{
|
||||||
this._socket.send(JSON.stringify(data));
|
this._socket.send(JSON.stringify(data));
|
||||||
clearInterval(loop_id);
|
|
||||||
}
|
}
|
||||||
}, 500);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_send_paddle_position(position, time)
|
_send_paddle_position(position, time)
|
||||||
|
Reference in New Issue
Block a user