2D-first game engine for MoonBit inspired by Ebiten
Dependencies
moon.work
|-- core/ Calculations: geometry, physics, terrain, input state
|-- platform/ Shared window/input/surface contracts
|-- platform_web/ Browser adapters and runtime_hooks/
|-- platform_native/ Native hooks, gfx_wgpu_native/, capture/
|-- engine/ Rendering, assets, application/runtime, scene, HUD
|-- game/ Rules, progression, ECS, inventory, input bindings
`-- editor/ Authoring and inspection tools| 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_birdmoon install ./cmd/kagura
kagura new my-game --web
cd my-game
pnpm install
kagura dev
kagura buildpnpm kagura dev hacknslash_3d --port 8080
pnpm kagura build hacknslash_3d --out-dir output/game
pnpm kagura studiobash scripts/setup-wgpu-native.sh
# Run with just (recommended -- sets CPATH/LIBRARY_PATH automatically)
just run-native flappy_bird
# 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 |
| 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:smokejust version 0.6.0 --dry-run # Preview affected modules and manifests
just version 0.6.0 # Update versions and regenerate Web runtime / CLI
just version 0.6.0 --check # Fail if any manifest version/reference differs
just check-release
just publish-status # Inspect packaged modules without uploadingfn 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 raiseInstall
Download zip2D-first game engine for MoonBit inspired by Ebiten
Dependencies