2D-first game engine for MoonBit inspired by Ebiten
Dependencies
moon.work
|-- mizchi/kagura Thin public facade over core/engine contracts
|-- mizchi/kagura_core Core contracts, math, camera, mesh, input utilities
|-- mizchi/kagura_engine Rendering/runtime infrastructure
| |-- platform/, gfx/ Platform, graphics, native/web backends
| |-- runtime/, asset/ Runtime loop, assets, audio, text, UI
| `-- gltf/, renderer*/ glTF loading and 2D/3D renderer facades
|-- mizchi/kagura_physics Reusable physics, collision, and pathfinding
|-- mizchi/kagura_game Gameplay-oriented packages
| |-- scene/ Declarative 2D Scene API
| `-- ai/, ecs/, tilemap2d/ Game systems and helpers
`-- mizchi/kagura_js_runtime JS-only WebGPU runtime helpers| Target | Backend | Status |
|---|---|---|
| Web (all OS) | WebGPU | Supported |
| Native macOS | wgpu-native + Metal + GLFW | Supported |
| Native Linux | wgpu-native + Vulkan + GLFW | Supported (CI: check + test + build) |
| Native Windows | wgpu-native + D3D12/Vulkan + GLFW | Partial (CI: check + build workaround; runtime validation pending) |
| WASM Guest | Shared-memory binary protocol | Supported (MoonBit / Rust / Zig) |
JS builds (browser) work on any OS. Native builds support macOS and Linux. Windows native build uses a repo-side workaround for the upstream -lm issue, but runtime validation is still limited.
pnpm install
just dev flappy_birdbash scripts/setup-wgpu-native.sh
# Run with just (recommended -- sets CPATH/LIBRARY_PATH automatically)
just run-native action_rpg
# Non-visual smoke test (window can appear black)
(cd examples/smoke/runtime_smoke_native && moon run src --target native)
# Visual sanity check
just run-native native_triangle| Example | Description |
|---|---|
| runtime_smoke | Minimal JS smoke test |
| runtime_smoke_native | Minimal native smoke test (non-visual) |
| native_triangle | Native backend triangle demo |
| flappy_bird | 2D game loop with input handling |
| survivor | Multi-entity game with weapons/UI |
| action_rpg | Action RPG prototype |
| arena3d | 3D arena prototype (experimental) |
(cd examples/<name> && moon run src --target <js|native>)just fmt
just check target=js
just test target=js
just check target=native
just test target=native
just check-release
pnpm e2e:smokefn plan_fixed_updates(state : FixedStepState, elapsed_ms : Double, config : FixedStepConfig) -> StepResultfn[G : Game, P : PlatformDriver, R : GraphicsDriver] run_loop(game : G, platform : P, graphics : R, options : RunOptions) -> Unit raise2D-first game engine for MoonBit inspired by Ebiten
Dependencies