Files
flappy-bird-rust/WEB_BUILD.md
Mitchell Hansen 9c0ad6fcba other files
2025-11-24 22:36:53 -08:00

50 lines
898 B
Markdown

# Building Flappy Bird for Web
## Prerequisites
1. Install the WebAssembly target:
```bash
rustup target add wasm32-unknown-unknown
```
2. Install wasm-bindgen-cli (will be done automatically by build script):
```bash
cargo install wasm-bindgen-cli
```
## Building
Run the build script:
```bash
./build-web.sh
```
This will:
- Build the WASM binary
- Generate JavaScript bindings
- Copy assets to the `web/` directory
- Copy the HTML file
## Running Locally
Serve the web directory with any HTTP server:
**Python:**
```bash
python3 -m http.server --directory web 8080
```
**Alternative (if you have basic-http-server):**
```bash
cargo install basic-http-server
basic-http-server web
```
Then open http://localhost:8080 in your browser!
## Notes
- The game uses WebGL2 for rendering
- All assets are included in the build
- Image sampling is set to nearest neighbor for crisp pixel art