A simple shoot 'em up style game using Rust's Bevy crate with a mobile friendly version.
Live demo (in webassembly) available at:
-
If you don't have
Rust
installed, seehttps://rustup.rs
-
Deploy with
cargo run --release
-
Your executable will be in ./target/release
-
If you don't have
Rust
installed, seehttps://rustup.rs
-
Then run the following commands:
-
rustup target install wasm32-unknown-unknown
-
cargo install -f wasm-bindgen-cli
-
cargo build --release --target wasm32-unknown-unknown
-
wasm-bindgen --out-dir ./out/ --target web ./target/wasm32-unknown-unknown/release/bevy-shoot-em-up.wasm
-
cp -r ./assets ./out
-
cargo build --release --target wasm32-unknown-unknown --features mobile
-
wasm-bindgen --out-dir ./out/mobile --target web ./target/wasm32-unknown-unknown/release/bevy-shoot-em-up.wasm
-
cp -r ./assets ./out/mobile
- The necessary files will be available at ./out
You can reduce the Wasm file size a little bit by running (must install binaryen
first):
-
wasm-opt -Oz out/bevy-shoot-em-up_bg.wasm -o out/bevy-shoot-em-up_bg.wasm
-
wasm-opt -Oz out/mobile/bevy-shoot-em-up_bg.wasm -o out/mobile/bevy-shoot-em-up_bg.wasm