diff options
| author | LLLL Colonq <llll@colonq> | 2026-06-18 16:15:46 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-06-18 16:15:46 -0400 |
| commit | c9fc2ca532c5219a087924ece1e38be19c25f006 (patch) | |
| tree | 7c9d8e32617fab6e6179fe70893a3027714ea4e7 /2026/index.html | |
| parent | 068f3b9dc0522b03af534479cfa300a720ae86fa (diff) | |
Update
Diffstat (limited to '2026/index.html')
| -rw-r--r-- | 2026/index.html | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/2026/index.html b/2026/index.html index 3216c75..9327020 100644 --- a/2026/index.html +++ b/2026/index.html @@ -127,9 +127,11 @@ for (let i of iframes) { i.classList.add("jam-hidden"); } microgame_index += 1; microgame_index %= microgames.length; + console.log(`attempting to start next game: ${microgame_index}`); if (microgames[microgame_index].ready) { startGame(microgame_index); } else { + console.log(`delaying start until game is ready!`); waiting_to_start = microgame_index; } } @@ -144,7 +146,7 @@ } window.addEventListener("message", ev => { - console.log(`received message: ${ev.data.op}`); + console.log(`received message: ${ev.data.op} (from ${ev.source.location.href})`); switch (ev.data.op) { case "ready": for (let mi = 0; mi < microgames.length; ++mi) { @@ -152,18 +154,18 @@ if (mg.loaded && ev.source.location.href === mg.loaded.src) { mg.ready = true; if (waiting_to_start === mi) { + console.log(`delayed game is ready, starting...`); startGame(mi); } } } break; case "started": + framing.contentWindow.postMessage({op: "startgame"}); microgames[microgame_index].loaded.contentWindow.focus(); break; case "done": - if (!ev.data.win) { - framing.contentWindow.postMessage({op: "loselife"}); - } + framing.contentWindow.postMessage({op: "endgame", win: ev.data.win}); startNextGameIfReady(); break; default: console.log(`unknown event: ${ev}`); break; |
