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

898 B

Building Flappy Bird for Web

Prerequisites

  1. Install the WebAssembly target:
rustup target add wasm32-unknown-unknown
  1. Install wasm-bindgen-cli (will be done automatically by build script):
cargo install wasm-bindgen-cli

Building

Run the build script:

./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:

python3 -m http.server --directory web 8080

Alternative (if you have basic-http-server):

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