From 5ff38f8c535743b75126784ee5e7f29a07def7a5 Mon Sep 17 00:00:00 2001 From: Ramirisu Date: Thu, 29 Aug 2024 22:33:14 +0800 Subject: [PATCH] Update readme for build instructions. --- README.md | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 14bf43e..dfb5a55 100644 --- a/README.md +++ b/README.md @@ -27,16 +27,52 @@ A Classic Tetris (NES Tetris) clone written in bevy/rust. | Action | Keyboard | Controller (NES) | | :--------------------------------------------- | :------: | :--------------: | -| Move Up | ↑ | ↑ | -| Move Down | ↓ | ↓ | | Move Left | ← | ← | | Move Right | → | → | +| Soft Drop | ↓ | ↓ | | Rotate Clockwisely | X | A | | Rotate Counterclockwisely | Z | B | | Start/Pause/Resume | Enter | Start | | Soft Reset | Esc | Select | | Toggle Windowed/FullScreen Mode (Desktop Only) | F11 | | +## Build & Run + +#### Web + +```sh + +cargo build --release --target wasm32-unknown-unknown +wasm-bindgen --no-typescript --target web --out-dir ./dist/tetris --out-name "tetris" ./target/wasm32-unknown-unknown/release/tetris.wasm +cp -r ./assets ./dist/assets + +# Start a web server to serve the files under "./dist" + +``` + +#### Linux + +Ubuntu + +```sh + +apt-get install g++ pkg-config libx11-dev libasound2-dev libudev-dev libxkbcommon-x11-0 +cargo build --release && cargo run --release + +``` + +#### Windows + +```sh + +cargo build --release && cargo run --release + +``` + +#### MacOS + +TODO: + ## License [MIT License](https://opensource.org/license/MIT)