/bevy-starter-project

Bevy starter project that compiles to webassembly

Primary LanguageRust

Bevy Starter Project

A basic bevy project with common libs and code snippets, that builds to webassembly.

Prerequisites

rustup target install wasm32-unknown-unknown +nightly
cargo install wasm-server-runner
cargo install wasm-bindgen-cli

To manage itch.io uploads from the command line, install butler.

Run locally

cargo run

Deploy

Does not work for me on Firefox for some reason, but works on Chrome.

Build

cargo build --release
wasm-bindgen --out-dir out/pkg --target web target/wasm32-unknown-unknown/release/bevy_starter_project.wasm
rsync -a assets/ out/assets/

Deploy locally

Build, then run this:

cd out
python3 -m http.server <port>

Deploy to itch.io

Build, then run this:

butler login # follow the instructions
zip -r bevy-starter-project.zip out
butler push bevy-starter-project.zip <user>/bevy-starter-project:html

If this is the first time uploading to the html channel, you need to go to the game page on itch.io and click on Edit game, then set it to playable in the browser.

TODO

  • Go through the code and fix everything marked with a TODO
  • Fix compilation targeting desktop
  • Fix bug where character can keep in the air if you jump into a corner and hold into a wall
  • Add scripts or cargo make commands to do stuff