diff options
Diffstat (limited to '2026/framing/src')
| -rw-r--r-- | 2026/framing/src/bindings.js | 11 | ||||
| -rw-r--r-- | 2026/framing/src/game.rs | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/2026/framing/src/bindings.js b/2026/framing/src/bindings.js index e9c2655..222b74d 100644 --- a/2026/framing/src/bindings.js +++ b/2026/framing/src/bindings.js @@ -5,3 +5,14 @@ export function js_update_lifetotal(lives) { export function js_ready_to_reset() { window.parent.postMessage({op: "readytoreset"}); } + +export function js_upload_highscore(score) { + if (typeof score === "number") { + let form = FormData(); + form.append("score", score); + fetch("https://api.colonq.computer/api/jam/2026/score", { + method: "POST", + body: form, + }); + } +} diff --git a/2026/framing/src/game.rs b/2026/framing/src/game.rs index 5284132..a473d8e 100644 --- a/2026/framing/src/game.rs +++ b/2026/framing/src/game.rs @@ -363,6 +363,7 @@ impl teleia::state::Game for Game { extern { fn js_update_lifetotal(lives: i32); fn js_ready_to_reset(); + fn js_upload_highscore(score :i32); } #[wasm_bindgen] |
