bevy_wasm & bevy_wasm_sys
Mod your Bevy games with WebAssembly!
bevy_wasm: For games [][https://crates.io/crates/bevy_wasm] [
][https://docs.rs/bevy_wasm]
bevy_wasm_sys: For mods [][https://crates.io/crates/bevy_wasm_sys] [
][https://docs.rs/bevy_wasm_sys]
See examples/cubes for a comprehensive example of how to use this.
Protocol
Our protocol crate defines the two message types for communicating between the game and mods.
use ;
use *;
/// The version of the protocol. Automatically set from the `CARGO_PKG_XXX` environment variables.
pub const PROTOCOL_VERSION: Version = version!;
/// A message to be sent Mod -> Game.
/// A message to be sent Game -> Mod.
Game
Our game will import WasmPlugin from bevy_wasm, and use it to automatically send and receive messages with the mods.
use *;
use *;
use ;
Mod
Our mod will import FFIPlugin from bevy_wasm_sys, and use it to automatically send and receive messages with the game.
use *;
use ;
pub unsafe extern "C"
Roadmap
| ✅ | wasmtime runtime in games |
| ✅ | Send messages from mods to game |
| ✅ | Send messages from game to mods |
| ✅ | Multi-mod support |
| ✅ | Time keeping |
| ✅ | Protocol version checking |
| ⬜ | Startup system mod loading |
| ⬜ | Custom FFI |
| ⬜ | Mod discrimination (events aren't broadcast all) |
| ⬜ | AssetServer support and Handle<WasmMod> |
| ⬜ | Mod unloading |
| ⬜ | Direct update control |
| ⬜ | Mod hotloading |
| ⬜ | Automatic component syncing |
| ⬜ | Browser support |