diff options
| author | LLLL Colonq <llll@colonq> | 2026-08-04 18:32:42 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-08-04 18:32:42 -0400 |
| commit | ee4b068359137edaa5ce6ce6a4e7e880dd65fe03 (patch) | |
| tree | 0b53319d8f0bb9b1fe772dad078220f6968dffc1 /2026/framing/index.html | |
| parent | ad2524a89f2a0e29088873b18eb458760fa796b1 (diff) | |
Fix high score load
Diffstat (limited to '2026/framing/index.html')
| -rw-r--r-- | 2026/framing/index.html | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/2026/framing/index.html b/2026/framing/index.html index b91b89a..60efac4 100644 --- a/2026/framing/index.html +++ b/2026/framing/index.html @@ -19,17 +19,17 @@ console.log("initialized, starting..."); window.wasmBindings.main_js(); }); - window.fetch("https://api.colonq.computer/api/leaderboard/jam2026?n=1").then(async (resp) => { - const top = await resp.json(); - const score = top?.[0]?.[2]; - if (typeof score === "number") { - console.log(`high score: ${score}`); - window.wasmBindings.set_leaderboard_highscore(score); - } - }); window.addEventListener("message", ev => { switch (ev.data.op) { case "titlescreenclick": + window.fetch("https://api.colonq.computer/api/leaderboard/jam2026?n=1").then(async (resp) => { + const top = await resp.json(); + const score = top?.[0]?.[2]; + if (typeof score === "number") { + console.log(`high score: ${score}`); + window.wasmBindings.set_leaderboard_highscore(score); + } + }); window.wasmBindings.titlescreen_click(); break; case "startgame": |
