From 45e643d306e5fccfbf21fa75373a66275212cdb2 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Tue, 2 Jun 2026 04:31:13 -0400 Subject: Multiple games loaded at once --- 2026/examples/godot/project/export_presets.cfg | 2 +- 2026/examples/godot/project/main.gd | 12 ++++---- 2026/examples/js/index.html | 39 ++++++++++++++++++++++++++ 2026/examples/raylib/build.sh | 2 +- 2026/examples/raylib/main.c | 2 +- 5 files changed, 48 insertions(+), 9 deletions(-) create mode 100644 2026/examples/js/index.html (limited to '2026/examples') 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/examples/js/index.html b/2026/examples/js/index.html new file mode 100644 index 0000000..f52c9c9 --- /dev/null +++ b/2026/examples/js/index.html @@ -0,0 +1,39 @@ + + + + + + In Between The Iframes + + + + + hello from the js example + + 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); -- cgit v1.2.3