Farm Stacker is a browser-first animal stacking game built with React, Vite, Capacitor, and Electron. The player drops farm animals onto a growing tower, starting with large animals and stepping down through smaller tiers until the stack reaches the mouse level.
- Web: primary playable version, built with Vite.
- Android: Capacitor debug APK build.
- Windows: Electron portable
.exebuild.
Committed release artifacts live in releases/.
Drop each animal as it moves horizontally across the screen. The landed overlap becomes the new stack width. If the animal hangs too far over the side, the excess is trimmed away with a harmless farm-themed poof effect. If it misses completely, the run enters retry mode.
Animal progression is width-based:
- Cow
- Pony
- Alpaca
- Goat
- Sheep
- Pig
- Duck
- Chicken
- Mouse
The smallest tier can repeat, allowing the tower to keep climbing after mouse level.
- Click / tap / Space: drop the current animal.
- Pause: pauses the active run.
- Sound: toggles game audio.
- Help: opens gameplay and power-up explanations.
- Retry: appears after a miss when retries remain.
QA-only controls are shown when the URL contains ?qa:
- Test: automatically stacks perfect placements.
- Size Test: forces the next placement toward the next smaller animal tier.
- Snap: near-perfect drops snap into place for 3 seconds.
- Slow: moving animals slow down for 10 seconds.
- Wide: the next drop is 20% wider. If it covers the animal below, it lands at the wider size. It is consumed after that one drop.
Power-up pacing:
- At least 7.5 seconds between any two spawned power-ups.
- At least 15 seconds before the same power-up type can spawn again.
- At least a 3-animal gap between spawned power-ups.
The active version is a 2D farm animal stacker with:
- A photorealistic loading/start image.
- A vertically scrolling farm-to-sky background.
- One barn window with a larger rooster.
- Duck and goose background moments higher in the run.
- Plain starfield after the space background.
- Realistic animal sprites with side-on placement.
The old cargo/shipping-container prototype was removed from this project and belongs in its separate fork.
android/ Capacitor Android project
build/ Desktop build resources, including icon.ico
docs/ Handoff, audio source, and theme notes
electron/ Electron desktop wrapper
public/themes/farm/ Farm theme assets, sprites, audio, UI, and backgrounds
releases/ Committed web, Android, and Windows artifacts
scripts/ Release packaging helpers
src/game/ Canvas gameplay, HUD, power-ups, retry flow
src/theme/ Theme manifest loading
- Node.js 20+ recommended.
- npm.
- Android Studio / Android SDK for Android builds.
- JDK 21 for the generated Capacitor Android project.
npm installnpm run devOpen:
http://127.0.0.1:5174/?theme=farm
QA route:
http://127.0.0.1:5174/?theme=farm&qa=1
npm run buildThe production web build is generated in dist/.
Make sure JAVA_HOME points to JDK 21. On Windows:
$env:JAVA_HOME = "C:\Program Files\Eclipse Adoptium\jdk-21.0.11.10-hotspot"
$env:Path = "$env:JAVA_HOME\bin;$env:Path"Build the debug APK:
npm run android:debugGradle output:
android/app/build/outputs/apk/debug/app-debug.apk
Committed release copy:
releases/farm-stacker-0.1.0-android-debug.apk
npm run desktop:winCommitted Windows launcher:
releases/win-unpacked/Farm Stacker.exe
Committed zipped Windows build:
releases/farm-stacker-0.1.0-windows-x64.zip
The Windows build is an Electron desktop app. The .exe depends on the adjacent files in releases/win-unpacked, so use the .zip when moving the app to another machine. It serves the bundled Vite build from a local loopback server inside the app, so the same browser asset paths work in desktop mode.
npm run release:artifactsThis builds and refreshes:
releases/farm-stacker-0.1.0-web.zip
releases/farm-stacker-0.1.0-android-debug.apk
releases/farm-stacker-0.1.0-windows-x64.zip
releases/win-unpacked/Farm Stacker.exe
npm run android:openThemes are loaded from public/themes/<theme-id>/theme.json. The current app only exposes the farm theme, but the theme manifest keeps assets grouped and normalized so future themes can reuse the same loader pattern.
