https://creack.github.io/wolf3d
go run go.creack.net/wolf3d@latestenv -i HOME=${HOME} PATH=${PATH} go run github.com/hajimehoshi/wasmserve@latest go.creack.net/wolf3d@latestInstall wasmer:
go install github.com/hajimehoshi/wasmserve@latestClone this repo:
git clone https://github.com/creack/wolf3d
cd wolf3dRun:
env -i HOME=${HOME} PATH=${PATH} wasmserve .For development, wasmer exposes an endpoint to do live reload.
I recommend reflex.
Install:
go install github.com/cespare/reflex@latestThen, with wasmer running:
reflex curl -v http://localhost:8080/_notify- up/down w/s: Move up/down.
- right/left: Turn right/left.
- a/d: Strife right/left.
A Dockerfile is provided to build and run the WASM version.
docker build -t wolf3d .To run the image, make sure to have:
--rmto avoid pollution-itso the app receives signals-pto expose the port 8080
Any changes to the code will require to re-build the image.
docker run --rm -p 8080:8080 -it wolf3d wasmserve .You can then access the WASM page at the Docker ip on port 8080. If in doubt about the IP, it is likely localhost.
For development, you can add -v $(pwd):/app to mount the local directory in the Docker container, the server will hot-reload when file changes.
docker run --rm -p 8080:8080 -it -v $(pwd):/app wolf3dLargely based on: