summaryrefslogtreecommitdiff
path: root/2026
diff options
context:
space:
mode:
Diffstat (limited to '2026')
-rw-r--r--2026/examples/godot/project/export_presets.cfg2
-rw-r--r--2026/examples/godot/project/main.gd12
-rw-r--r--2026/examples/js/index.html (renamed from 2026/game.html)2
-rwxr-xr-x2026/examples/raylib/build.sh2
-rw-r--r--2026/examples/raylib/main.c2
-rw-r--r--2026/framing/art/mrworld.asepritebin0 -> 12122 bytes
-rw-r--r--2026/framing/src/assets/textures/mrworld.pngbin0 -> 10491 bytes
-rw-r--r--2026/framing/src/game.rs5
-rw-r--r--2026/index.html81
-rw-r--r--2026/jam2026.pngbin0 -> 20315 bytes
-rw-r--r--2026/test.pngbin144382 -> 0 bytes
-rw-r--r--2026/testsmall.pngbin3925 -> 0 bytes
12 files changed, 62 insertions, 44 deletions
diff --git a/2026/examples/godot/project/export_presets.cfg b/2026/examples/godot/project/export_presets.cfg
index 9d45cd8..5633989 100644
--- a/2026/examples/godot/project/export_presets.cfg
+++ b/2026/examples/godot/project/export_presets.cfg
@@ -8,7 +8,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
-export_path="../output/game.html"
+export_path="../output/index.html"
patches=PackedStringArray()
patch_delta_encoding=false
patch_delta_compression_level_zstd=19
diff --git a/2026/examples/godot/project/main.gd b/2026/examples/godot/project/main.gd
index 051ee04..268afbc 100644
--- a/2026/examples/godot/project/main.gd
+++ b/2026/examples/godot/project/main.gd
@@ -2,15 +2,15 @@ extends Node
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
- JavaScriptBridge.eval("window.parent.postMessage({op: \"ready\"});")
+ JavaScriptBridge.eval("window.parent.postMessage({op: \"ready\"});")
var started = false
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
- if !started && JavaScriptBridge.eval("window.lcolonqJamStart || -1.0") > 0.0:
- started = true
- JavaScriptBridge.eval("window.parent.postMessage({op: \"started\"});")
+ if !started && JavaScriptBridge.eval("window.lcolonqJamStart || -1.0") > 0.0:
+ started = true
+ JavaScriptBridge.eval("window.parent.postMessage({op: \"started\"});")
func _input(event) -> void:
- if event is InputEventMouseButton:
- JavaScriptBridge.eval("window.parent.postMessage({op: \"done\", win: true});")
+ if event is InputEventMouseButton:
+ JavaScriptBridge.eval("window.parent.postMessage({op: \"done\", win: true});")
diff --git a/2026/game.html b/2026/examples/js/index.html
index 8d33605..f52c9c9 100644
--- a/2026/game.html
+++ b/2026/examples/js/index.html
@@ -34,6 +34,6 @@
</script>
</head>
<body>
- <img id="game-test" src="./testsmall.png"></img>
+ hello from the js example
</body>
</html>
diff --git a/2026/examples/raylib/build.sh b/2026/examples/raylib/build.sh
index 6454acc..93411e4 100755
--- a/2026/examples/raylib/build.sh
+++ b/2026/examples/raylib/build.sh
@@ -1,4 +1,4 @@
#!/bin/sh
set -xeu -o pipefail
mkdir -p output
-emcc -I./raylib/src libraylib.a -s USE_GLFW=3 -s ASYNCIFY --shell-file ./raylib/src/minshell.html main.c -DPLATFORM_WEB -o output/game.html
+emcc -I./raylib/src libraylib.a -s USE_GLFW=3 -s ASYNCIFY --shell-file ./raylib/src/minshell.html main.c -DPLATFORM_WEB -o output/index.html
diff --git a/2026/examples/raylib/main.c b/2026/examples/raylib/main.c
index c047aa7..a070382 100644
--- a/2026/examples/raylib/main.c
+++ b/2026/examples/raylib/main.c
@@ -21,7 +21,7 @@ int main(int argc, char **argv) {
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) {
printf("clicked\n");
emscripten_run_script("window.parent.postMessage({op: \"done\", win: false});");
- return 0;
+ started = false;
}
BeginDrawing();
ClearBackground(RED);
diff --git a/2026/framing/art/mrworld.aseprite b/2026/framing/art/mrworld.aseprite
new file mode 100644
index 0000000..fb4a5f3
--- /dev/null
+++ b/2026/framing/art/mrworld.aseprite
Binary files differ
diff --git a/2026/framing/src/assets/textures/mrworld.png b/2026/framing/src/assets/textures/mrworld.png
new file mode 100644
index 0000000..1f2d166
--- /dev/null
+++ b/2026/framing/src/assets/textures/mrworld.png
Binary files differ
diff --git a/2026/framing/src/game.rs b/2026/framing/src/game.rs
index 8e819c0..5e84503 100644
--- a/2026/framing/src/game.rs
+++ b/2026/framing/src/game.rs
@@ -182,6 +182,11 @@ impl teleia::state::Game for Game {
ctx.clear_color(glam::Vec4::ZERO);
ctx.clear();
self.renderer.text_screen(ctx, st, glam::Vec2::new(0.0, 0.0), "hi");
+ self.renderer.bind_uber_2d(ctx, st, UberFlags::TEXTURE_COLOR | UberFlags::SPRITE);
+ self.renderer.bind_texture(ctx, st, assets::Texture::Mrworld);
+ self.renderer.set_texture_offset(ctx, st, 2, 1, ((st.tick / 15) % 2) as i32, 0);
+ self.renderer.set_position_2d(ctx, st, glam::Vec2::ZERO, st.render_dims);
+ self.renderer.render_square(ctx, st);
self.lives.render(ctx, st, &mut self.renderer)?;
Ok(())
}
diff --git a/2026/index.html b/2026/index.html
index f45326c..14f629a 100644
--- a/2026/index.html
+++ b/2026/index.html
@@ -40,43 +40,63 @@
<body>
<div id="jam-iframe-parent">
<iframe id="jam-framing-iframe" width="480" height="320" src="./framing/dist/index.html"></iframe>
- <!-- <iframe id="jam-game-iframe" width="240" height="160" src="./examples/godot/output/game.html"></iframe> -->
<iframe id="jam-game-iframe-0" class="jam-hidden" width="240" height="160"></iframe>
<iframe id="jam-game-iframe-1" class="jam-hidden" width="240" height="160"></iframe>
<iframe id="jam-game-iframe-2" class="jam-hidden" width="240" height="160"></iframe>
<iframe id="jam-game-iframe-3" class="jam-hidden" width="240" height="160"></iframe>
<iframe id="jam-game-iframe-4" class="jam-hidden" width="240" height="160"></iframe>
- <!-- <iframe id="jam-game-iframe" width="240" height="160" src="game.html"></iframe> -->
<div>
<script type="module">
+ let framing = document.getElementById("jam-framing-iframe");
let microgame_index = 0;
let microgames = [
- {url: "./examples/raylib/output/game.html", loaded: null},
- {url: "./examples/godot/output/game.html", loaded: null},
+ {url: "./examples/raylib/output/index.html", loaded: null, ready: false},
+ {url: "./examples/godot/output/index.html", loaded: null, ready: false},
+ {url: "./examples/js/index.html", loaded: null, ready: false},
];
- let framing = document.getElementById("jam-framing-iframe");
let iframes = [...Array(5).keys()].map(i => document.getElementById(`jam-game-iframe-${i}`));
+ function resizeView() {
+ let least_ratio = Math.min(Math.floor(window.innerWidth / 480), Math.floor(window.innerHeight / 320));
+ let factor = Math.max(1, least_ratio);
+ for (let i of iframes) {
+ i.style["transform"] = `scale(${factor})`;
+ }
+ framing.style["transform"] = `scale(${factor})`;
+ }
+ resizeView();
window.addEventListener("resize", resizeView);
+ for (let i of iframes) {
+ i.addEventListener("load", () => {
+ i.contentDocument.body.style["overflow"] = "hidden";
+ i.contentDocument.body.style["image-rendering"] = "pixelated";
+ });
+ }
+
function loadGame(i) {
if (!microgames[i].loaded) {
+ console.log(`loading: ${i}`)
for (let iframe of iframes) {
- if (!iframe.src) {
+ if (iframe.src == "") {
iframe.src = microgames[i].url;
+ console.log(`setting src ${iframe.src}`);
microgames[i].loaded = iframe;
+ return;
}
}
}
}
function unloadGame(i) {
- if (microgames[i].loaded) {
- microgames[i].loaded.src = null;
- microgaems[i].loaded = null;
+ if (microgames[i] && microgames[i].loaded) {
+ console.log(`unloading: ${i}`)
+ microgames[i].loaded.src = "";
+ microgames[i].loaded = null;
+ microgames[i].ready = false;
}
}
function loadUpcomingGames() {
let first = true;
let to_load = Math.min(5, microgames.length);
- for (let i = (microgame_index + to_load) % microgames.len; i != microgame_index; i = (i + 1) % microgames.length) {
+ for (let i = (microgame_index + to_load) % microgames.length; i != microgame_index; i = (i + 1) % microgames.length) {
unloadGame(i)
}
for (let off = 0; off < to_load; ++off) {
@@ -84,49 +104,42 @@
loadGame(i)
}
}
- function readyNextGame() {
+
+ function startNextGame() {
loadUpcomingGames();
for (let i of iframes) { i.classList.add("jam-hidden"); }
- microgames[microgame_index].loaded.classList.remove("jam-hidden");
microgame_index += 1;
microgame_index %= microgames.length;
+ const resp = {op: "start", difficulty: 1.0};
+ microgames[microgame_index].loaded.contentWindow.postMessage(resp);
+ microgames[microgame_index].loaded.contentWindow.lcolonqJamStart = resp.difficulty;
+ microgames[microgame_index].loaded.classList.remove("jam-hidden");
}
- readyNextGame();
+
+ startNextGame();
+
window.addEventListener("message", ev => {
- console.log(ev.data);
+ console.log(`received message: ${ev.data.op}`);
switch (ev.data.op) {
case "ready":
- window.setTimeout(() => {
- const resp = {op: "start", difficulty: 1.0};
- game.contentWindow.postMessage(resp);
- game.contentWindow.lcolonqJamStart = resp.difficulty;
- }, 1000);
+ for (let mg of microgames) {
+ if (mg.loaded && ev.source.location.href === mg.loaded.src) {
+ mg.ready = true;
+ }
+ }
break;
case "started":
- game.contentWindow.focus();
+ microgames[microgame_index].loaded.contentWindow.focus();
break;
case "done":
if (!ev.data.win) {
framing.contentWindow.postMessage({op: "loselife"});
}
- readyNextGame();
+ startNextGame();
break;
default: console.log(`unknown event: ${ev}`); break;
}
});
- game.addEventListener("load", () => {
- game.contentDocument.body.style["overflow"] = "hidden";
- game.contentDocument.body.style["image-rendering"] = "pixelated";
- });
- function resizeView() {
- let least_ratio = Math.min(Math.floor(window.innerWidth / 480), Math.floor(window.innerHeight / 320));
- let factor = Math.max(1, least_ratio);
- console.log(factor);
- game.style["transform"] = `scale(${factor})`;
- console.log(game.style.transform);
- framing.style["transform"] = `scale(${factor})`;
- }
- resizeView();
</script>
</body>
</html>
diff --git a/2026/jam2026.png b/2026/jam2026.png
new file mode 100644
index 0000000..9a111f0
--- /dev/null
+++ b/2026/jam2026.png
Binary files differ
diff --git a/2026/test.png b/2026/test.png
deleted file mode 100644
index 91cd1dd..0000000
--- a/2026/test.png
+++ /dev/null
Binary files differ
diff --git a/2026/testsmall.png b/2026/testsmall.png
deleted file mode 100644
index 88c56ba..0000000
--- a/2026/testsmall.png
+++ /dev/null
Binary files differ