blob: 766a08af0a221caa282d9331d3d06199d1b1ee04 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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} />
|