For building:
- zig (
master
branch
For running the game in browser:
- A development web server, like
livereload
orsimple-http-server
- An up to date web browser
To run it on desktop:
- Install SDL
- run
zig build run
To build the WASM, use zig build:
$ zig build wasm
To run the game, start the web server and navigate to the page in you browser:
$ cd ./zig-cache/www
$ livereload
[I 200215 23:06:51 server:296] Serving on http://127.0.0.1:35729
[I 200215 23:06:51 handlers:62] Start watching changes
[I 200215 23:06:51 handlers:64] Start detecting changes
And in this case, I would navigate to http://127.0.0.1:35729
.
We need this server because web browsers will not run WASM unless it is served from a server with the appropriate mime type.
WebGL bindings generator was based on the generator in oxid.