No description
- C 88.9%
- HTML 6.3%
- GLSL 4.1%
- Makefile 0.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo/workflows | ||
| assets | ||
| src | ||
| web | ||
| .gitignore | ||
| Makefile | ||
| Makefile.wasm | ||
| README.md | ||
bee gets bread
Split-screen 2-player raylib game (bees, honey, beer).
Desktop
make
./build/split_screen
Needs raylib-devel (see install-deps in Makefile).
Web (WASM)
Built with Emscripten in the Arch distrobox (host has no emcc).
One-time setup — raylib for WebGL2 (raylib 5.5 to match desktop):
distrobox enter arch -- sh -c 'export PATH=$PATH:/usr/lib/emscripten && cd ~/raylib/src && make PLATFORM=PLATFORM_WEB GRAPHICS=GRAPHICS_API_OPENGL_ES3 -B -j$(nproc)'
Build + serve:
distrobox enter arch -- sh -c 'export PATH=$PATH:/usr/lib/emscripten && make -f Makefile.wasm'
python3 -m http.server -d build/web 8000
# open http://localhost:8000/index.html
Notes:
build/web/containsindex.html/index.js/index.wasm/index.data. Zip that directory for itch.io, or publish it to GitHub Pages. Don't usefile://—.wasm/.dataneed HTTP.- Click the game once to enable audio (browser autoplay policy).
settings.cfgpersists in IndexedDB (IDBFS) on web, assettings.cfgnext to the binary on desktop.- The
.databundle is ~7 MB:audiotrack.ogg(64kbps Vorbis, ~4 MB),ground_grass.jpg(1024px, ~400 KB),ground_rock.jpg(~250 KB). Keep music compressed and textures small — everything underassets/ships in the bundle. web/shell.htmlcarries aModule.HEAPF32shim: raylib 5.5's miniaudio (0.11.21) reads it in its WebAudio callback, but Emscripten 6.x no longer aliases HEAP views ontoModule. Without the shim every audio quantum throwsTypeError: Cannot read properties of undefined (reading 'buffer'). Revisit when upgrading raylib/emscripten.- Web shaders live in
assets/ground_web.vs/assets/ground_web.fs(GLSL ES 3.00 twins ofground.vs/ground.fs); selected automatically on__EMSCRIPTEN__builds. - Web page is bare fullscreen black (
web/shell.html): canvas fills the viewport, framebuffer tracks the window, no text except a tiny CSS spinner while loading. Logs go to the browser console only. - On resize the game calls
SetWindowSizeto re-sync Emscripten's GLFW size struct; without it mouse coordinates scale from a stale size and every click misses. Makefile.wasm(notMakefile.web):maketreatsMakefile.webas a Knuth-WEB source for regeneratingMakefileand breaks withouttangle.