summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2026-08-07 02:38:20 -0400
committerLLLL Colonq <llll@colonq>2026-08-07 02:38:20 -0400
commitbc9e1abe138aa17b190f2611eb75876207fd4754 (patch)
tree59492a2156470b43eb22c55f21a18d2a4c0c4724
parentc35b9c655f0da9da706d4f7194db62e5b0521fde (diff)
Transition states earlier
-rw-r--r--2026/framing/dist/game_lib-138a5d10eb1dc5d0.js (renamed from 2026/framing/dist/game_lib-60b0f4d05477534a.js)0
-rw-r--r--2026/framing/dist/game_lib-138a5d10eb1dc5d0_bg.wasm (renamed from 2026/framing/dist/game_lib-60b0f4d05477534a_bg.wasm)bin21820618 -> 21820613 bytes
-rw-r--r--2026/framing/dist/index.html6
-rw-r--r--2026/index.html32
4 files changed, 16 insertions, 22 deletions
diff --git a/2026/framing/dist/game_lib-60b0f4d05477534a.js b/2026/framing/dist/game_lib-138a5d10eb1dc5d0.js
index d064b5e..d064b5e 100644
--- a/2026/framing/dist/game_lib-60b0f4d05477534a.js
+++ b/2026/framing/dist/game_lib-138a5d10eb1dc5d0.js
diff --git a/2026/framing/dist/game_lib-60b0f4d05477534a_bg.wasm b/2026/framing/dist/game_lib-138a5d10eb1dc5d0_bg.wasm
index f08e49f..e13f703 100644
--- a/2026/framing/dist/game_lib-60b0f4d05477534a_bg.wasm
+++ b/2026/framing/dist/game_lib-138a5d10eb1dc5d0_bg.wasm
Binary files differ
diff --git a/2026/framing/dist/index.html b/2026/framing/dist/index.html
index 8619567..c0e6e14 100644
--- a/2026/framing/dist/index.html
+++ b/2026/framing/dist/index.html
@@ -6,8 +6,8 @@
<meta charset="UTF-8">
<script type="module">
-import init, * as bindings from '/framing/dist/game_lib-60b0f4d05477534a.js';
-const wasm = await init({ module_or_path: '/framing/dist/game_lib-60b0f4d05477534a_bg.wasm' });
+import init, * as bindings from '/framing/dist/game_lib-138a5d10eb1dc5d0.js';
+const wasm = await init({ module_or_path: '/framing/dist/game_lib-138a5d10eb1dc5d0_bg.wasm' });
window.wasmBindings = bindings;
@@ -23,7 +23,7 @@ dispatchEvent(new CustomEvent("TrunkApplicationStarted", {detail: {wasm}}));
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
<link rel="stylesheet" href="/framing/dist/index-1e3cd2ca0ba4d1ec.css" integrity="sha384-1q3UDTmLdOyf9/QxW+Imap//HWhTWNfvn7j2iwuUap3HSD6IOGG7pDS9VJMk7nKv"/>
<title>Jam 2026 Framing Device</title>
- <link rel="modulepreload" href="/framing/dist/game_lib-60b0f4d05477534a.js" crossorigin="anonymous" integrity="sha384-34feKGwj4If/0actH/hiCFakcYWMtlOocNU1HlGnqccoo50laWtXrwhn8jl/peMw"><link rel="modulepreload" href="/framing/dist/snippets/teleia-727bf4351691f1c8/src/helpers.js" crossorigin="anonymous" integrity="sha384-HhtEY2WfGmhyPUSRWKZvqsRxYsdT/DLEdFUqWyDZt6G6lrNHmE1zMlw4BJ3RycRd"><link rel="modulepreload" href="/framing/dist/snippets/game_lib-09da6449fcb9d06e/src/bindings.js" crossorigin="anonymous" integrity="sha384-5OqMgKkpxoyJdg0zjf0uRBl5lKhgxNx4rdX+ML4CRyveCr3dizM3Lbxs58MxUzTz"><link rel="preload" href="/framing/dist/game_lib-60b0f4d05477534a_bg.wasm" crossorigin="anonymous" integrity="sha384-aSPyubkdVZZrANV9QpIDhVP7dqhZTBloPiCvDXsIRxSJnhV1LYLTttHDa/a4iDPb" as="fetch" type="application/wasm"></head>
+ <link rel="modulepreload" href="/framing/dist/game_lib-138a5d10eb1dc5d0.js" crossorigin="anonymous" integrity="sha384-34feKGwj4If/0actH/hiCFakcYWMtlOocNU1HlGnqccoo50laWtXrwhn8jl/peMw"><link rel="modulepreload" href="/framing/dist/snippets/teleia-727bf4351691f1c8/src/helpers.js" crossorigin="anonymous" integrity="sha384-HhtEY2WfGmhyPUSRWKZvqsRxYsdT/DLEdFUqWyDZt6G6lrNHmE1zMlw4BJ3RycRd"><link rel="modulepreload" href="/framing/dist/snippets/game_lib-09da6449fcb9d06e/src/bindings.js" crossorigin="anonymous" integrity="sha384-5OqMgKkpxoyJdg0zjf0uRBl5lKhgxNx4rdX+ML4CRyveCr3dizM3Lbxs58MxUzTz"><link rel="preload" href="/framing/dist/game_lib-138a5d10eb1dc5d0_bg.wasm" crossorigin="anonymous" integrity="sha384-UJRhBMW9WTTBMjCFsSt7lnKfdh4W1Wl7HuWwqsB0vff5cYn0/pm/Bm+M17uGUHfi" as="fetch" type="application/wasm"></head>
<body>
<script type="module">
window.addEventListener("TrunkApplicationStarted", async (event) => {
diff --git a/2026/index.html b/2026/index.html
index 7920cd9..8c2163e 100644
--- a/2026/index.html
+++ b/2026/index.html
@@ -122,7 +122,10 @@
// microgame state machine
let state = {mode: "titlescreen"};
- console.log(state);
+ function setState(st) {
+ console.log(`changed state from ${JSON.stringify(state)} to ${JSON.stringify(st)}`);
+ state = st;
+ }
window.lcolonqState = () => state;
function confirmReadyGame(idx) {
// readiness is independent of state - we expect ready events to arrive in the background,
@@ -136,52 +139,46 @@
}
function finishGame(idx, win) {
if (state.mode === "running" && state.idx === idx) {
+ setState({mode: "waitingforlives"});
microgames[idx].loaded.contentWindow.lcolonqJamStart = null;
microgames[idx].loaded.classList.add("jam-hidden");
framing.contentWindow.postMessage({op: "endgame", win: win});
loadUpcomingGames();
- state = {mode: "waitingforlives"};
- console.log(state);
}
}
function receivedLifeTotal(lives) {
if (state.mode === "waitingforlives") {
console.log(`lives remaining: ${lives}`);
if (lives <= 0) {
- state = {mode: "gameover"};
- console.log(state);
+ setState({mode: "gameover"});
framing.contentWindow.postMessage({op: "gameover", streak: streak - 1});
} else {
+ setState({mode: "finished"});
streak += 1;
- state = {mode: "finished"};
- console.log(state);
setTimeout(startNextGameIfReady, 4000);
}
}
}
function readyToReset(lives) {
if (state.mode === "gameover") {
- state = {mode: "readytoreset"};
- console.log(state);
+ setState({mode: "readytoreset"});
}
}
function startGame(idx) {
if (state.mode == "waiting" && state.idx === idx) {
+ setState({mode: "starting", idx: idx});
console.log(`actually starting game: ${idx}`);
const resp = {op: "start", difficulty: streak};
microgames[idx].loaded.contentWindow.postMessage(resp);
microgames[idx].loaded.contentWindow.lcolonqJamStart = resp.difficulty;
microgames[idx].loaded.classList.remove("jam-hidden");
- state = {mode: "starting", idx: idx};
- console.log(state);
}
}
function confirmStartGame(idx, verb) {
if (state.mode == "starting" && state.idx === idx) {
+ setState({mode: "running", idx: idx});
framing.contentWindow.postMessage({op: "startgame", verb: verb});
microgames[idx].loaded.contentWindow.focus();
- state = {mode: "running", idx: idx};
- console.log(state);
}
}
function startNextGameIfReady() {
@@ -189,9 +186,8 @@
for (let i of iframes) { i.classList.add("jam-hidden"); }
microgame_index += 1;
microgame_index %= microgames.length;
+ setState({mode: "waiting", idx: microgame_index});
console.log(`attempting to start next game: ${microgame_index}`);
- state = {mode: "waiting", idx: microgame_index};
- console.log(state);
if (microgames[microgame_index].ready) {
startGame(microgame_index);
} else {
@@ -226,18 +222,16 @@
document.body.addEventListener("click", () => {
switch (state.mode) {
case "titlescreen":
- state = {mode: "finished"};
- console.log(state);
+ setState({mode: "finished"});
framing.contentWindow.postMessage({op: "titlescreenclick"});
loadUpcomingGames();
setTimeout(startNextGameIfReady, 8000);
break;
case "readytoreset":
+ setState({mode: "titlescreen"});
framing.contentWindow.postMessage({op: "reset"});
microgame_index = 0;
streak = 1;
- state = {mode: "titlescreen"};
- console.log(state);
}
});
</script>