diff options
| author | LLLL Colonq <llll@colonq> | 2026-05-28 20:16:38 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-05-28 20:16:38 -0400 |
| commit | fa4d63110a3e12d0242b6e6ddcded74d04480f28 (patch) | |
| tree | 330e6ccfe650f1fd9143f9db67b481d4c74a2e05 /2026/examples | |
Initial commit
Diffstat (limited to '2026/examples')
| -rw-r--r-- | 2026/examples/godot/.gitignore | 1 | ||||
| -rw-r--r-- | 2026/examples/godot/project/.editorconfig | 4 | ||||
| -rw-r--r-- | 2026/examples/godot/project/.gitignore | 1 | ||||
| -rw-r--r-- | 2026/examples/godot/project/export_presets.cfg | 49 | ||||
| -rw-r--r-- | 2026/examples/godot/project/hello.tscn | 24 | ||||
| -rw-r--r-- | 2026/examples/godot/project/icon.svg | 1 | ||||
| -rw-r--r-- | 2026/examples/godot/project/icon.svg.import | 43 | ||||
| -rw-r--r-- | 2026/examples/godot/project/main.gd | 16 | ||||
| -rw-r--r-- | 2026/examples/godot/project/main.gd.uid | 1 | ||||
| -rw-r--r-- | 2026/examples/godot/project/output.zip | bin | 0 -> 6241 bytes | |||
| -rw-r--r-- | 2026/examples/godot/project/project.godot | 31 | ||||
| l--------- | 2026/examples/raylib/.direnv/flake-profile | 1 | ||||
| l--------- | 2026/examples/raylib/.direnv/flake-profile-1-link | 1 | ||||
| -rw-r--r-- | 2026/examples/raylib/.envrc | 1 | ||||
| -rw-r--r-- | 2026/examples/raylib/.gitignore | 2 | ||||
| -rwxr-xr-x | 2026/examples/raylib/build.sh | 3 | ||||
| -rwxr-xr-x | 2026/examples/raylib/build_raylib.sh | 11 | ||||
| -rw-r--r-- | 2026/examples/raylib/main.c | 33 | ||||
| -rw-r--r-- | 2026/examples/raylib/nix/flake.lock | 27 | ||||
| -rw-r--r-- | 2026/examples/raylib/nix/flake.nix | 17 |
20 files changed, 267 insertions, 0 deletions
diff --git a/2026/examples/godot/.gitignore b/2026/examples/godot/.gitignore new file mode 100644 index 0000000..7e902e8 --- /dev/null +++ b/2026/examples/godot/.gitignore @@ -0,0 +1 @@ +output/*
\ No newline at end of file diff --git a/2026/examples/godot/project/.editorconfig b/2026/examples/godot/project/.editorconfig new file mode 100644 index 0000000..f28239b --- /dev/null +++ b/2026/examples/godot/project/.editorconfig @@ -0,0 +1,4 @@ +root = true + +[*] +charset = utf-8 diff --git a/2026/examples/godot/project/.gitignore b/2026/examples/godot/project/.gitignore new file mode 100644 index 0000000..7c58247 --- /dev/null +++ b/2026/examples/godot/project/.gitignore @@ -0,0 +1 @@ +.godot/*
\ No newline at end of file diff --git a/2026/examples/godot/project/export_presets.cfg b/2026/examples/godot/project/export_presets.cfg new file mode 100644 index 0000000..9d45cd8 --- /dev/null +++ b/2026/examples/godot/project/export_presets.cfg @@ -0,0 +1,49 @@ +[preset.0] + +name="Web" +platform="Web" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="../output/game.html" +patches=PackedStringArray() +patch_delta_encoding=false +patch_delta_compression_level_zstd=19 +patch_delta_min_reduction=0.1 +patch_delta_include_filters="*" +patch_delta_exclude_filters="" +encryption_include_filters="" +encryption_exclude_filters="" +seed=0 +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +variant/extensions_support=false +variant/thread_support=false +vram_texture_compression/for_desktop=true +vram_texture_compression/for_mobile=false +html/export_icon=true +html/custom_html_shell="" +html/head_include="" +html/canvas_resize_policy=2 +html/focus_canvas_on_start=true +html/experimental_virtual_keyboard=false +progressive_web_app/enabled=false +progressive_web_app/ensure_cross_origin_isolation_headers=true +progressive_web_app/offline_page="" +progressive_web_app/display=1 +progressive_web_app/orientation=0 +progressive_web_app/icon_144x144="" +progressive_web_app/icon_180x180="" +progressive_web_app/icon_512x512="" +progressive_web_app/background_color=Color(0, 0, 0, 1) +threads/emscripten_pool_size=8 +threads/godot_pool_size=4 diff --git a/2026/examples/godot/project/hello.tscn b/2026/examples/godot/project/hello.tscn new file mode 100644 index 0000000..f71ad9b --- /dev/null +++ b/2026/examples/godot/project/hello.tscn @@ -0,0 +1,24 @@ +[gd_scene format=3 uid="uid://cv48btpqtacm5"] + +[ext_resource type="Script" uid="uid://daenwy22luvh3" path="res://main.gd" id="1_p3r8j"] + +[sub_resource type="LabelSettings" id="LabelSettings_i7k7o"] +font_size = 30 + +[node name="Control" type="Control" unique_id=427036785] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_p3r8j") + +[node name="Label" type="Label" parent="." unique_id=341561866] +layout_mode = 0 +offset_left = 1.0 +offset_top = 22.0 +offset_right = 806.0 +offset_bottom = 159.0 +text = "hello from godot" +label_settings = SubResource("LabelSettings_i7k7o") diff --git a/2026/examples/godot/project/icon.svg b/2026/examples/godot/project/icon.svg new file mode 100644 index 0000000..c6bbb7d --- /dev/null +++ b/2026/examples/godot/project/icon.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg> diff --git a/2026/examples/godot/project/icon.svg.import b/2026/examples/godot/project/icon.svg.import new file mode 100644 index 0000000..40c9021 --- /dev/null +++ b/2026/examples/godot/project/icon.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cxf3v8xhk65r2" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/2026/examples/godot/project/main.gd b/2026/examples/godot/project/main.gd new file mode 100644 index 0000000..051ee04 --- /dev/null +++ b/2026/examples/godot/project/main.gd @@ -0,0 +1,16 @@ +extends Node + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + 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\"});") + +func _input(event) -> void: + if event is InputEventMouseButton: + JavaScriptBridge.eval("window.parent.postMessage({op: \"done\", win: true});") diff --git a/2026/examples/godot/project/main.gd.uid b/2026/examples/godot/project/main.gd.uid new file mode 100644 index 0000000..e004c01 --- /dev/null +++ b/2026/examples/godot/project/main.gd.uid @@ -0,0 +1 @@ +uid://daenwy22luvh3 diff --git a/2026/examples/godot/project/output.zip b/2026/examples/godot/project/output.zip Binary files differnew file mode 100644 index 0000000..6bfe31a --- /dev/null +++ b/2026/examples/godot/project/output.zip diff --git a/2026/examples/godot/project/project.godot b/2026/examples/godot/project/project.godot new file mode 100644 index 0000000..3cc0e4d --- /dev/null +++ b/2026/examples/godot/project/project.godot @@ -0,0 +1,31 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="jam-example" +run/main_scene="uid://cv48btpqtacm5" +config/features=PackedStringArray("4.6", "GL Compatibility") +config/icon="res://icon.svg" + +[display] + +window/size/viewport_width=240 +window/size/viewport_height=160 + +[physics] + +3d/physics_engine="Jolt Physics" + +[rendering] + +rendering_device/driver.windows="d3d12" +renderer/rendering_method="gl_compatibility" +renderer/rendering_method.mobile="gl_compatibility" diff --git a/2026/examples/raylib/.direnv/flake-profile b/2026/examples/raylib/.direnv/flake-profile new file mode 120000 index 0000000..0c05709 --- /dev/null +++ b/2026/examples/raylib/.direnv/flake-profile @@ -0,0 +1 @@ +flake-profile-1-link
\ No newline at end of file diff --git a/2026/examples/raylib/.direnv/flake-profile-1-link b/2026/examples/raylib/.direnv/flake-profile-1-link new file mode 120000 index 0000000..8f6f619 --- /dev/null +++ b/2026/examples/raylib/.direnv/flake-profile-1-link @@ -0,0 +1 @@ +/nix/store/xska2chszdi2m9qa6cnig39w8aihqqcw-nix-shell-env
\ No newline at end of file diff --git a/2026/examples/raylib/.envrc b/2026/examples/raylib/.envrc new file mode 100644 index 0000000..9160bb3 --- /dev/null +++ b/2026/examples/raylib/.envrc @@ -0,0 +1 @@ +use_flake path:nix
\ No newline at end of file diff --git a/2026/examples/raylib/.gitignore b/2026/examples/raylib/.gitignore new file mode 100644 index 0000000..ea9ccd0 --- /dev/null +++ b/2026/examples/raylib/.gitignore @@ -0,0 +1,2 @@ +libraylib.a +output/*
\ No newline at end of file diff --git a/2026/examples/raylib/build.sh b/2026/examples/raylib/build.sh new file mode 100755 index 0000000..f176746 --- /dev/null +++ b/2026/examples/raylib/build.sh @@ -0,0 +1,3 @@ +#!/bin/sh +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 diff --git a/2026/examples/raylib/build_raylib.sh b/2026/examples/raylib/build_raylib.sh new file mode 100755 index 0000000..71aa025 --- /dev/null +++ b/2026/examples/raylib/build_raylib.sh @@ -0,0 +1,11 @@ +#!/bin/sh +cd raylib/src/ +emcc -c rcore.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2 +emcc -c rshapes.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2 +emcc -c rtextures.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2 +emcc -c rtext.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2 +emcc -c rmodels.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2 +emcc -c raudio.c -Os -Wall -DPLATFORM_WEB + +emar rcs libraylib.a rcore.o rshapes.o rtextures.o rtext.o rmodels.o raudio.o +mv libraylib.a ../.. diff --git a/2026/examples/raylib/main.c b/2026/examples/raylib/main.c new file mode 100644 index 0000000..64091b5 --- /dev/null +++ b/2026/examples/raylib/main.c @@ -0,0 +1,33 @@ +#include <raylib.h> +#include <emscripten.h> +#include <stdio.h> +#include <stdbool.h> + +int main(int argc, char **argv) { + InitWindow(240, 160, "test game raylib mode"); + SetTargetFPS(60); + emscripten_run_script("window.parent.postMessage({op: \"ready\"});"); + bool started = false; + while (!WindowShouldClose()) { + if (!started) { + double difficulty = EM_ASM_DOUBLE({return window.lcolonqJamStart || -1.0;}); + printf("difficulty: %f\n", difficulty); + if (difficulty > 0.0) { + started = true; + emscripten_run_script("window.parent.postMessage({op: \"started\"});"); + printf("started at difficulty: %f\n", difficulty); + } + } else { + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) { + printf("clicked\n"); + emscripten_run_script("window.parent.postMessage({op: \"done\", win: true});"); + return 0; + } + BeginDrawing(); + ClearBackground(RED); + DrawText("hello gamer", 0, 0, 20, WHITE); + EndDrawing(); + } + } + return 0; +} diff --git a/2026/examples/raylib/nix/flake.lock b/2026/examples/raylib/nix/flake.lock new file mode 100644 index 0000000..7461ca0 --- /dev/null +++ b/2026/examples/raylib/nix/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1779694939, + "narHash": "sha256-Ly4j75O8ICaSQx3uxPnwk2x7PMF0XQvn5r0c3yBA7FI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f9d8b65950353691ab56561e7c73d2e1063d810b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/2026/examples/raylib/nix/flake.nix b/2026/examples/raylib/nix/flake.nix new file mode 100644 index 0000000..d51dd3a --- /dev/null +++ b/2026/examples/raylib/nix/flake.nix @@ -0,0 +1,17 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + + outputs = { self, nixpkgs, ... }@inputs: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + devShells.x86_64-linux.default = pkgs.mkShell { + buildInputs = [ + pkgs.emscripten + ]; + }; + }; +} |
