This is all Rahn's idea, you can blame him I'm just the code monkey!
cargo watch -q -c -x 'run --features bevy/dynamic_linking'
cargo run --features bevy/dynamic_linking
trying to get this working for all the browser kids
You will need a few things installed on the dev machine:
https://bevy-cheatbook.github.io/platforms/wasm.html
rustup target install wasm32-unknown-unknown
cargo install wasm-server-runner
https://rustwasm.github.io/wasm-bindgen/reference/cli.html
cargo install -f wasm-bindgen-cli
cargo run --target wasm32-unknown-unknown
note: currently fails on my windows box complaining about missing c compiler dependencies but works on the github actions toolchain which is good enough for me
cargo build --release --target wasm32-unknown-unknown --features = tiled/wasm
The following command will create js and wasm
wasm-bindgen --no-typescript --out-dir wasm --target web .\target\wasm32-unknown-unknown\release\conveyor.wasm
not really set up to do this easily, but if you copy the assets tree into the wasm folder you can run the game via a local http server
python -m http.server
Deployed as draft currently, if you really want to try it here's a secret URL:
https://the-trav.itch.io/conveyor?secret=mHY5xzc2ZragwWTbl8C0X8Tr8
It's more set up for auto deployment to itch.io via butler. For my own memory sake, I had to:
- First create the project at itch.io
- Run a local docker container containing butler
- Do the login so it registered its own API key, (that's probably against my account and I can use for future projects)
- Then I put that key in the github secrets for the action
- Run the butler push
- go to the itch project page, edit the game, set the channel I uploaded to html5 play in browser
Related to bevyengine/bevy#8150 the bevy texture atlas seems to have problematic sampling at the edges.
I've found that if I use tile maps with any spacing, at some zoom levels the renderer picks the wrong pixel and you get the padding from the tile map showing through making your game look like it's gone through a wire mesh.
There's some talk about MSAA fixing it, however I haven't had any luck there. Using individual sprite files also could fix it, but there are warnings around doing that with wasm deployments