From 619a039942c3c02552f72275634a9f6c0788c570 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Thu, 20 Jul 2023 22:22:26 -0700 Subject: very basic websocket setup --- client/src/JumpStorm.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'client/src/JumpStorm.ts') diff --git a/client/src/JumpStorm.ts b/client/src/JumpStorm.ts index 45ea163..d1d1013 100644 --- a/client/src/JumpStorm.ts +++ b/client/src/JumpStorm.ts @@ -11,9 +11,16 @@ import { export class JumpStorm { private game: Game; + private socket: WebSocket; constructor(ctx: CanvasRenderingContext2D) { this.game = new Game(); + this.socket = new WebSocket("ws://localhost:8080"); + + this.socket.onopen = () => { + this.socket.send("gaming"); + console.log("OPENED SOCKET"); + }; [ this.createInputSystem(), -- cgit v1.2.3-70-g09d2