fuzzyworld

herd

App: https://apps.fuzzyworld.net/herd/

Contribute: contrib-68uq+herd@fuzzyworld.net (how) · Report a bug: bugs-k7q4+herd@fuzzyworld.net

phone

git clone https://code.fuzzyworld.net/herd.git

Open in VS Code · Open in VS Code in the browser · CI: ✓ passed

Recent commits

2026-10-27fe82cd2✓ Rename .gitlab-ci.yml to .fw-ci.ymlPavel Safronov
2026-10-265a542e9Deploy to apps.fuzzyworld.net with fuzzyworld-toolsPavel Safronov
2026-05-173ccad7dImprove sheep visual differentiation and pen behaviourPavel Safronov
2026-05-1782e8c06Refactor UI from canvas to DOMPavel Safronov
2026-05-1768f7d10Add level progression locking and enlarge level-select buttonsPavel Safronov

Full log

Herd 🐑

A browser game about herding sheep. Tap the field to move your border collie and guide the flock into the pen before time runs out.

Play it →


How to Play

Sheep flock together naturally, so a little pressure in the right direction goes a long way. Chasing them head-on scatters the herd — work from the sides and behind.


Tech Stack

Tool Role
TypeScript Language
Vite Dev server & bundler
HTML5 Canvas Rendering
npm Package management
GitLab Pages Hosting

No game engine — physics, flocking AI, and rendering are all hand-rolled.


Development

Prerequisites

Setup

git clone https://code.fuzzyworld.net/herd.git
cd herd
npm install

Run locally

npm run dev

Opens at http://localhost:5173.

Build

npm run build      # outputs to dist/
npm run preview    # serve the production build locally

Deployment

Pushes to main automatically deploy to GitLab Pages via .gitlab-ci.yml. The live URL is https://<namespace>.gitlab.io/herd.


Project Structure

src/
├── main.ts           # entry point
├── math/Vec2.ts      # immutable 2D vector math
├── game/             # loop, canvas setup, game state machine
├── entities/         # Sheep, Dog, Pen
├── ai/Boids.ts       # flocking forces (separation, alignment, cohesion, flee)
├── input/            # pointer event → world coordinate mapping
└── levels/           # level configs (sheep count, pen size, time limit)

The sheep use a boids flocking algorithm extended with a flee force triggered by the dog's proximity.


Credits

Grass / field icon (favicon + logo) by Icongeek26 from the Flaticon outline collection.


License

MIT