0.1.0-1-alpha.2-fix.3

This commit is contained in:
2026-09-17 00:29:56 +02:00
parent 37a00b3c2b
commit b31ffa74f5
17 changed files with 349 additions and 57 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/apps/game-reflex-poc-tauri/frontend/ts/game.ts
// version: 1
// version: 2
import init, { ReflexWasmGame } from "../wasm/game_reflex_poc_wasm.js";
import { tracingDebug, tracingTrace } from "./logging";
@@ -37,7 +37,7 @@ function render(game: ReflexWasmGame, canvas: HTMLCanvasElement, context: Canvas
score.value = `Score : ${game.score()}`;
}
export async function startGame(canvas: HTMLCanvasElement, score: HTMLOutputElement): Promise<void> {
export async function startGame(canvas: HTMLCanvasElement, score: HTMLOutputElement): Promise<ReflexWasmGame> {
await init();
await tracingDebug("Reflex WASM module initialized");
const context = canvas.getContext("2d");
@@ -64,4 +64,5 @@ export async function startGame(canvas: HTMLCanvasElement, score: HTMLOutputElem
}
render(game, canvas, context, score);
window.requestAnimationFrame(frame);
return game;
}