Here lives an example of leveraging the Doom WebAssembly module (doom.wasm) produced by this repo in order to run Doom via Python, making use of the Wasmtime WebAssembly runtime and PyGame in the process.
This example leverages all the features supported by doom.wasm. Particularly, this example supports the loading of custom WADs into Doom, and supports the user saving their game progress.
The make target run exists for running this example.
To run this example one must provide a path to a copy of doom.wasm, as produced by this repo, via the PATH_TO_DOOM_WASM env variable.
If you've built doom.wasm locally then such a path, relative to here, would be ../../build/doom.wasm. If that's the case then here's how you'd run this example:
make run PATH_TO_DOOM_WASM=../../build/doom.wasmThere is also a make target (run-with-a-custom-pwad) that serves as a demonstration of how to load a custom WAD into Doom when running this example. This is done like this:
make run-with-a-custom-pwad PATH_TO_DOOM_WASM=../../build/doom.wasm