Wip reworking server handleInput

+ fixedDeltaTime for server
This commit is contained in:
LuckyLaszlo
2022-11-28 23:55:24 +01:00
parent c656de5cad
commit 429387ce83
5 changed files with 46 additions and 22 deletions

View File

@@ -2,13 +2,17 @@
import { WebSocket } from "../wsServer.js";
import { Racket } from "../../shared_js/class/Rectangle.js";
import { GameSession } from "./GameSession.js";
import * as ev from "../../shared_js/class/Event.js"
class Client {
socket: WebSocket;
id: string; // Pas indispensable si "socket" a une copie de "id"
lastInputId: number = 0;
isAlive: boolean = true;
gameSession: GameSession;
inputArr: ev.EventInput[] = [];
lastInputId: number = 0;
constructor(socket: WebSocket, id: string) {
this.socket = socket;
this.id = id;