898 B
898 B
Building Flappy Bird for Web
Prerequisites
- Install the WebAssembly target:
rustup target add wasm32-unknown-unknown
- 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