From 0fd9fb097552686f2257c1aa689d797e80057bd1 Mon Sep 17 00:00:00 2001
From: Elizabeth Hunt <elizabeth.hunt@simponic.xyz>
Date: Wed, 19 Jul 2023 20:38:24 -0700
Subject: initial commit

---
 client/src/components/GameCanvas.svelte | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 client/src/components/GameCanvas.svelte

(limited to 'client/src/components/GameCanvas.svelte')

diff --git a/client/src/components/GameCanvas.svelte b/client/src/components/GameCanvas.svelte
new file mode 100644
index 0000000..766a08a
--- /dev/null
+++ b/client/src/components/GameCanvas.svelte
@@ -0,0 +1,28 @@
+<script lang="ts">
+  import { onMount } from "svelte";
+  import { Game } from "../../lib/Game";
+  import { Render } from "../../lib/systems";
+  import { Floor } from "../../lib/entities";
+  import { loadAssets } from "../../lib/config";
+  import { JumpStorm } from "../../lib/JumpStorm";
+
+  let canvas: HTMLCanvasElement;
+  let ctx: CanvasRenderingContext2D;
+
+  export let width: number;
+  export let height: number;
+
+  let jumpStorm: JumpStorm;
+
+  onMount(() => {
+    ctx = canvas.getContext("2d");
+    ctx.imageSmoothingEnabled = false;
+
+    loadAssets().then(() => {
+      jumpStorm = new JumpStorm(ctx);
+      jumpStorm.play();
+    });
+  });
+</script>
+
+<canvas bind:this={canvas} {width} {height} />
-- 
cgit v1.2.3-70-g09d2

