Skip to content

ungabo/farm-stacker

Repository files navigation

Farm Stacker

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.

Farm Stacker loading and start screen

Current Platforms

  • Web: primary playable version, built with Vite.
  • Android: Capacitor debug APK build.
  • Windows: Electron portable .exe build.

Committed release artifacts live in releases/.

Gameplay

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:

  1. Cow
  2. Pony
  3. Alpaca
  4. Goat
  5. Sheep
  6. Pig
  7. Duck
  8. Chicken
  9. Mouse

The smallest tier can repeat, allowing the tower to keep climbing after mouse level.

Controls

  • 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.

Power-Ups

  • 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.

Visual Direction

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.

Project Structure

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

Requirements

  • Node.js 20+ recommended.
  • npm.
  • Android Studio / Android SDK for Android builds.
  • JDK 21 for the generated Capacitor Android project.

Install

npm install

Run Web Version

npm run dev

Open:

http://127.0.0.1:5174/?theme=farm

QA route:

http://127.0.0.1:5174/?theme=farm&qa=1

Build Web Version

npm run build

The production web build is generated in dist/.

Build Android APK

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:debug

Gradle output:

android/app/build/outputs/apk/debug/app-debug.apk

Committed release copy:

releases/farm-stacker-0.1.0-android-debug.apk

Build Windows EXE

npm run desktop:win

Committed 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.

Package All Release Artifacts

npm run release:artifacts

This 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

Android Studio

npm run android:open

Notes For Future Themes

Themes 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages