summaryrefslogtreecommitdiff
path: root/2026/framing/src
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2026-08-04 17:58:22 -0400
committerLLLL Colonq <llll@colonq>2026-08-04 17:58:22 -0400
commitad2524a89f2a0e29088873b18eb458760fa796b1 (patch)
treed0aa7066821b73b291f27a9c02addc89cf4518c3 /2026/framing/src
parentcc8514251ee1828908161756228fa1c8357effc2 (diff)
Fix
Diffstat (limited to '2026/framing/src')
-rw-r--r--2026/framing/src/bindings.js11
-rw-r--r--2026/framing/src/game.rs1
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]