
Out past the barn there’s a field. In the field there’s a haystack of fifteen million hay, and next to it, a hole.
Your job is to feed twelve million of that hay to the hole. Nobody tells you why.
That’s The Haystack, a pixel-art factory and tower defence game you can play free in your browser right now. There’s nothing to download, no account and no ads, and it works on your phone.
Why I made it
For years I’ve been working on a tower defence engine in plain JavaScript. It was one of those projects I’d start and restart every year, never be satisfied with, throw away, and start again.
I grew up on Flash tower defence games. I played a lot of Elemental Tower Defence, but my favourite was Desktop Tower Defence, mostly on the Casual Collective site. I loved how pathing worked in that game, where the towers themselves made the maze.
I also love games about keeping a system flowing. Cities: Skylines (the traffic management in particular), RollerCoaster Tycoon and Factorio. So I wanted a tower defence game where a factory, with its own traffic problems, is the source of income that pays for the towers.
Then there’s the horror fan in me. I’ve always loved the Lovecraftian idea of feeding some unknowable thing. And a factory plus a defence needs a lot of open ground. Enter the hay and the farmland. Everything else grew from there, including the monsters raiding the haystack directly and the look of the whole game.
The basic loop
You start with your bare hands. Click the haystack to grab one hay, click the hole to feed it, and the hole pays you a dollar. Do that a few dozen times and you can afford a grain shovel.
From there it snowballs in the way incremental games do:
- Tools. Bare hands, a grain shovel, a pitchfork, then a hay hook. Each grab costs stamina, so heavier tools move more hay but tire you faster.
- Robot arms. They grab from the stack by themselves and drop the hay on a port behind them.
- Belts. They carry that hay to the hole, so you don’t have to.
- Generators. Arms and belts run on power, and power comes from burning hay.
That last point is the core tension. There are fifteen million hay and you need twelve million, so you have three million to spare. Every hay you burn for power is hay that will never reach the hole. Burn too much and the hole will still hunger.
The stack also shrinks as you take from it. Arms placed at the old edge slowly lose their reach, so you either upgrade them or follow the stack inward onto the ground it gives up. That ground has strange concentric rings carved into it. I’ll come back to that.

Belts and gates
This is the Factorio and Cities: Skylines part of my brain, and I’m proud of how it feels.
Belts are drawn by dragging. Drag out of an arm’s port and the belt follows your pointer, turning corners as it goes. Drop it on the hole and hay starts flowing. Drag off the middle of an existing belt and that tile becomes a gate.
Gates split hay up to three ways, at exact ratios, allowing you do to things like a 70/15/15 split. That matters, because your generators need a steady trickle, not a flood followed by a drought.

The rest of the traffic toolbox:
- Merges. End a belt on the side of another and they join, up to three into one.
- Crossings. Drag straight across a belt and yours bridges over it. The two flows never mix.
- Brownouts. If power runs short, belts slow to a crawl first while the arms keep a small reserve, so the factory can never deadlock. You fix it by sending more hay to the generators.
- Upgrades. Faster belts and heavier belt grades carry more, but they draw more power per tile, which means burning more hay.
Design choices
Nothing is explained
There’s no story, no narrator and no tutorial beyond a few short hints. The horror is only ever implied. You’ll find yourself asking why you’re feeding the hole.
A ledger instead of a toolbar
The screen stays almost empty: a tally of hay fed, your money, your stamina and your power. Everything else lives in a worn farm ledger. You buy machines from it, read your accounts in it, and sometimes notice notes in the margin in a second handwriting that isn’t yours.

There’s no tool bar either. You hold one tool, and it’s always the best one you own. On a computer the tool is your cursor.
Two game modes

The default mode, Hunted, adds monsters that raid the haystack. If they eat too much hayโฆ the hole gets angry.
But you can also play in Quiet mode if you’d only like to play the management side of the game. There are no raids, no towers and no monsters. It even works as a passive idle game you leave running on a second screen, especially on a Marathon field.
You also choose how long a field should take: Brief (about an hour), Standard (about two), Long (about four) or Marathon (about eight). Prices and pacing scale to fit, and the game keeps your best time for each.
The slow corruption
This is the part I’m proudest of, and the game never mentions it.
The field starts in a warm, endless dusk. As you feed the hole, it changes. The warmth drains out. The birds stop coming. The grass starts leaning toward the hole. Crows appear on the field and never, ever move. The light turns cold and cyan, and rings surface under the stack. Near the end, the stack loses its shadow and the hole starts casting one.
Drag the slider to see the same factory as the hay goes in.





Every so often a line of text appears at the bottom of the screen, too. They’re not hints, and they get darker the more you feed.
The raids
On a Hunted field, the hole isn’t the only thing that’s hungry.
Once you’ve fed your first hundred thousand hay, the raids begin. They come on a clock whether you’re ready or not, about eighteen of them in a Standard game, and every hay milestone makes them stronger.
The warning
You get about a minute’s notice, and the game uses all of it. A red line appears (“something in the far grass”). An arrow points to where they’re coming from, and an arc lights up on that side of the stack. A bank of mist rolls in at that edge, the crows burst up from it, the grass ripples, and a chittering sound comes from that side of your speakers.

They eat the haystack
The monsters don’t attack you or your machines. They go straight for the stack and eat until their bellies are full, then walk home. Whatever they eat is gone for good, and killing a monster gives nothing back. The HUD tallies it in red as it happens.
Eaten hay comes out of the same three-million spare as burned hay, so every raid that gets through leaves you less room to burn hay for power.
Their pathing is where the Desktop Defence love shows up. Monsters take the shortest route to an open spot on the stack, and spread around it rather than queueing. Machines and stones block them, but belts don’t, so your factory shapes the battlefield. If you build something in their way, they find a new route. The one thing you can’t do is wall the stack off completely.
They change as you feed the hole
Early monsters are barely there: a dither of shadow and two cyan eyes. As the hole is fed and the field corrupts, they solidify. By the last raids they have flesh, mouths, sickles and far too many eyes. Like everything else, this is never announced.

There are several kinds. Chaff are fast swarms with small bellies. Gleaners are tall and slow with huge bellies, and they’re the ones you can’t let through. Moths fly straight over your walls. Burrowers come up through the carvings beside the stack. Leeches ignore the hay and latch onto your generators, drinking their fuel and cutting your power until a tower kills them. And the final raid brings something much bigger.
The towers
Towers are bought from the ledger, and every one has to stand on a rock. There are rocks scattered around the field, and you can buy more. Towers fire on power, so the factory that feeds the hole is also what keeps the defence running.
- Salt Sprinkler. A brass sprinkler on a drum of salt. It sweeps back and forth, and each pellet hits the first monster in line.
- Tesla Scarecrow. Lightning that jumps between up to three monsters.
- Weathervane Rooster. A personal favourite. Its crow is a flash of dawn light that hurts everything around it, and it’s strongest while the monsters are still made of shadow.
- Pest Sprayer. A poison cloud that melts the small ones. The big ones barely notice.
- Pitchfork Ballista. A giant pitchfork fired at the biggest thing in range, pinning it in place.
- Horseshoe Arch. Doesn’t attack at all. It makes the towers near it hit harder and faster.
- Silo Mortar. Long-range shells lobbed into the thickest part of the crowd.
- Ward Stone. A continuous beam of the hole’s own cyan light. It costs $4 million, and each one after that costs double.
When the field is lost
If the monsters eat enough that twelve million can no longer be reached, the dusk finally ends.
Winning has its own ending. I won’t spoil that one (but it’s especially cool).
How it’s built
For the curious: The Haystack is plain HTML, CSS and JavaScript, with no framework, no build step and no dependencies.
- No image or audio files. Every sprite is drawn in code from small palettes, which is how the whole field can recolour as it corrupts. Every sound, from the hole’s drone to the wind and the chittering, is made live with the Web Audio API.
- Installable. It can be installed like an app, and it plays offline.
Try it
The Haystack is free and runs in any modern browser, on a computer or a phone. Your progress saves automatically.
If it’s your first time, start a Standard field on Hunted. If you’d rather just build, pick Quiet and a long pace, and let it run beside you while you work.