server reconciliation OK (a little rubberbanding)

This commit is contained in:
LuckyLaszlo
2022-11-23 10:43:12 +01:00
parent 2b9058ad49
commit 7d5895a6cc
10 changed files with 110 additions and 33 deletions

View File

@@ -29,6 +29,7 @@ class EventGameUpdate extends ServerEvent {
playerLeft = {y: 0};
playerRight = {y: 0};
ball = {x: 0, y: 0, speed: 0};
lastInputId = 0;
constructor() { // TODO: constructor that take GameComponentsServer maybe ?
super(en.EventTypes.gameUpdate);
}
@@ -73,9 +74,11 @@ class ClientAnnounce extends ClientEvent {
class EventInput extends ClientEvent {
input: en.InputEnum;
constructor(input: en.InputEnum = 0) {
inputId: number;
constructor(input: en.InputEnum = 0, inputId: number = 0) {
super(en.EventTypes.clientInput);
this.input = input;
this.inputId = inputId;
}
}