A starter null0 cart, in Jik.
Press Use this template to make your own, then search the project for mygame and rename it to whatever your game is called.
Everything is built inside docker, so you never install jik (transpiles to C) + wasi-sdk yourself. All you need is docker, plus node for the shortcuts below.
npm startThat builds webroot/mygame.null0, serves webroot/, and rebuilds whenever you edit something in cart/. To build once, without the server:
npm run buildOr call docker yourself:
rm -f webroot/mygame.null0
docker run --rm --user $(id -u):$(id -g) --platform linux/amd64 -v ./cart:/src -v ./webroot:/out ghcr.io/notnullgames/null0-cart-jik:latest mygameThis image is
linux/amd64only, so on Apple Silicon it runs under emulation. That works, it is just slow.
Your code is in cart/main.jik. A cart implements the callbacks it cares about and the host skips the rest:
export func update() -> void- Jik's types don't line up with the null0 ABI, so null0.jik is a set of
externdeclarations and C wrappers to copy into your cart's@embedblock. - Jik has no string type at all, so the 25 functions taking text cannot be declared - keep the literal inside the C wrapper.
Run npm run bindings to drop the current null0.jik into cart/ for your editor. It is gitignored on purpose - fetch it again whenever you want, rather than letting a stale copy rot in your repo.
- Jik carts - the whole API, in Jik
- Anatomy of a cart - callbacks, input, distribution
- API reference
Two workflows come with this template:
- Publish builds the cart and deploys
webroot/to github-pages on every push tomain, so anyone can play your game in a browser without installing anything. - Release attaches
mygame.null0to any github release you create.
Players who want it natively can grab the runtime and run null0 mygame.null0.