diff --git a/README.md b/README.md index d971739..3890cb7 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ See [the contributing guide](./CONTRIBUTING.md) for instructions on how to get s - [Confetti mouse demo](./examples/confetti/main.rs) - [Moving box](./examples/moving-box/main.rs) -## Running +## Running in native window Run examples (`celeste`, `moving_box`, `confetti`) with: @@ -49,3 +49,34 @@ Or run `cargo run --bin` to get a list of the available examples. Press the `Escape` key to switch between the game and the editor. +## Running on the Steamdeck + +Run examples (`celeste`, `moving_box`, `confetti`) with: + +```bash +cargo run --bin celeste -- --game --feature steamdeck +cargo run --bin confetti -- --game --feature steamdeck +cargo run --bin moving-box -- --game --feature steamdeck +``` + +This will ensure to have a better scale/window size which fits the small screen. +Please note for now it only works in desktop mode on the deck + +## Running in browser using WASM + +Run examples (`celeste`, `moving_box`, `confetti`) with: + +```bash +rustup target add wasm32-unknown-emscripten +rustup target add wasm32-unknown-unknown +cargo install wasm-bindgen-cli + +./build_script.sh celeste +``` + +If you see an error with serve ensure to install the tool as well via cargo. +Alternative you can use any static web server to host the files located in the folder generated + +```bash +cd ./generated +``` diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 60a3333..613bf15 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -9,6 +9,10 @@ runty8 = { path = "../src/runty8" } runty8-core = { path = "../src/runty8-core" } log = "0.4" +[features] +default = [] +steamdeck = ["runty8/steamdeck"] + [[bin]] name = "celeste" path = "./celeste/main.rs" diff --git a/src/runty8-core/src/input.rs b/src/runty8-core/src/input.rs index ec46726..922284a 100644 --- a/src/runty8-core/src/input.rs +++ b/src/runty8-core/src/input.rs @@ -69,8 +69,8 @@ impl Input { fn key_to_button(key: Key) -> Option