summaryrefslogtreecommitdiff
path: root/client/src
diff options
context:
space:
mode:
Diffstat (limited to 'client/src')
-rw-r--r--client/src/JumpStorm.ts7
-rw-r--r--client/src/routes/Home.svelte7
2 files changed, 12 insertions, 2 deletions
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(),
diff --git a/client/src/routes/Home.svelte b/client/src/routes/Home.svelte
index 935ed69..9ada10e 100644
--- a/client/src/routes/Home.svelte
+++ b/client/src/routes/Home.svelte
@@ -2,8 +2,11 @@
import GameCanvas from "../components/GameCanvas.svelte";
import LeaderBoard from "../components/LeaderBoard.svelte";
- let width: number = 600;
- let height: number = 800;
+ import { Miscellaneous } from "@engine/config";
+
+ let width: number = Miscellaneous.WIDTH;
+ let height: number = Miscellaneous.HEIGHT;
+
</script>
<div class="centered-game">