Potato Catcher is a small 2D game built in Rust with the Bevy engine. You control a character named "Potato Man" and catch potatoes as they fall from the top of the screen, racking up a score as you go. The game runs natively via Cargo, or it can be compiled to WebAssembly and served in the browser through a lightweight Go static file server, with deployment wired up for Google Cloud Run.
- Catch falling potatoes by moving Potato Man left and right.
- Live score tracking via an on-screen counter.
- Sprite and audio assets (Potato Man, potatoes, catch/harvest sounds).
- Timer-driven potato spawning with randomized positions.
- Runs natively or in the browser via a WebAssembly build.
- Containerized Go web server for serving the WASM build, deployable to Google Cloud Run.
| Area | Technology |
|---|---|
| Game engine | Bevy 0.13.2 |
| Language | Rust (edition 2021) |
| Randomization | rand 0.8.5 |
| Web target | WebAssembly (wasm32-unknown-unknown, wasm-bindgen) |
| Web server | Go 1.22 static file server |
| Packaging / deploy | Docker, Google Cloud Run, Google Cloud Storage |
- Rust and Cargo installed on your machine.
Clone the repository and enter the project directory:
git clone https://github.com/jackinf/potato-catcher.git
cd potato-catcherBuild and run the game natively:
cargo build
cargo runThe game can be compiled to WASM and served in the browser. Install the wasm-bindgen CLI,
build the WASM target, and generate the web bindings:
cargo install wasm-bindgen-cli
cargo build --target wasm32-unknown-unknown --release
wasm-bindgen target/wasm32-unknown-unknown/release/potato-catcher.wasm --out-dir out --webThe Makefile provides a wasm-build target that wraps these steps and copies the generated
files into static/. The Go server (main.go) serves the static/ directory on port 8080
with the correct MIME types for .wasm and audio assets:
go build -o main .
./mainFor full cloud deployment to Google Cloud Run (bucket setup, Docker build/push, and
gcloud run deploy), see Deployment.md and the targets in the Makefile.
potato-catcher/
├── src/
│ ├── main.rs # App entry point / Bevy setup
│ ├── components/ # ECS components (potato, potato_man, score_text, ...)
│ ├── resources/ # Game resources (score, spawn timer)
│ └── systems/ # Game systems (spawn, movement, collision, falling)
├── assets/ # Sprites, fonts, and sound effects
├── static/ # WASM build output and web frontend (index.html, JS)
├── main.go # Go static file server for the web build
├── Dockerfile # Container image for the web server
├── Makefile # WASM build + GCP Cloud Run deployment targets
├── Deployment.md # Detailed deployment guide
└── Cargo.toml # Rust crate manifest
