
A melee survivor-style game has a design problem that auto-shooters do not: if the player never presses an attack button, how do you make every hit feel earned instead of automatic?
When we built SCARECROW SMASHER — a free iron ball arena brawler in the browser where you only move and a chained flail does the smashing — the answer came down to physics and readability. If your footwork directly drives the ball's speed, if speed unlocks clearly visible power tiers, and if the chain itself sweeps light enemies into the head, then movement becomes your attack button.
Here is how the simulation, Three.js HDR dusk pipeline, and card-family build system work under the hood.
Watch the 16:9 gameplay trailer: SCARECROW SMASHER Official Trailer on YouTube
Why a swinging ball needs 240 Hz sub-stepping
The entire combat loop lives in a pure, deterministic 60 Hz TypeScript simulation (src/sim/flail.ts) with no DOM or clock dependencies. Inside each 1/60 s tick, however, the flail runs 4 sub-steps (SUB_DT = 1/240 s).
At 60 Hz alone, a fast iron ball orbiting a 3-metre chain (CHAIN_LEN = 3.0) at top speed (V_MAX = 36 units/s) travels 0.6 metres per frame—wider than a small scarecrow—and a single-step constraint pull causes jitter whenever the player reverses direction. Sub-stepping at 240 Hz solves both:
- Tension-only rope constraint: In each sub-step, the hero's hand interpolates smoothly from its previous tick position to its new one. The ball accelerates tangentially toward a target speed
V_T = 8 * arm + 1.1 * heroSpeed, experiences low air drag (0.15/s), and then gets constrained back onto the3.0-unit circle only when the chain goes taut—removing outward radial velocity without ever pushing the ball away like a rigid rod. - Mass-fair twirl acceleration: Early playtests exposed a classic roguelite trap: picking a heavier ball like the Millstone made it feel awful to spin up. We locked the arm's twirl acceleration to
TWIRL_FORCE / IRON_MASSregardless of head weight, so heavier balls spin up just as responsively as iron while keeping their higher impact and lower slowdown on contact. - Three speed bands with hysteresis:
- Below
V_DRAG = 3units/s, extra floor drag (2.5/s) slows the ball and it deals no damage. - At
V_GOLD = 14units/s, the ball turns gold and hits hard. - At
V_RED = 22units/s (reached by running fast or tightening into small circles), it glows white-hot for maximum damage. - Stepping down requires dropping
0.6units/s (BAND_HYST) below each threshold so neither the colour nor the sound ever flickers on a boundary.
Making the chain feel tactile instead of frustrating
A swinging head on a tether creates two classic physics edge cases: small enemies slipping inside the arc, and the ball getting wedged against a heavy boss. We handled both directly in the flail sub-step:
- Chain sweep for light enemies: Any enemy with
mass <= 3(Little Scarecrows, standard Scarecrows, Hounds, Lanterns, Crows) that touches the chain segment is swept outward along the chain at16units/s straight into the iron ball. - Lantern safety rule: Exploding pumpkin-head Lanterns (
BLAST_RADIUS = 2.6) are never detonated by your own sweep while the ball is closer than2.5units to the hero—preventing the chain from accidentally blowing a lantern up in your face when slack. - Anti-wedge swing-back on Brutes and the Scarecrow King: Heavy enemies (
mass 40andmass 400) take one chain strike per crossing and act solid during hit cooldowns. If the ball stalls belowV_DRAGwhile turning into a solid heavy body,solidTouchreverses its spin at4units/s (SOLID_SWING_BACK) so it bounces cleanly back into motion instead of jamming.
Combos, FRENZY, and ground-warning discipline
Every burst enemy adds +1 to your combo and refreshes a 2.5-second window (paused when no enemies are alive or while FRENZY is active). Reaching combo milestones at 10, 25, 50, 100, and 200 boosts how fast smashes fill your card bar—up to 3× speed.
At 20 quick smashes (and every 60 smashes after that in the same streak: 20, 80, 140, 200...), you trigger a 6-second FRENZY: the flail arm hits 1.6× stronger drive speed, impacts count 1.5×, and the ball stops bouncing off targets. Taking damage that reduces your life ends your combo (though any active FRENZY finishes its timer), which gives every red line and circle on the arena floor double weight: dodging saves both health and momentum.
Keeping a dusk 3D arena crisp in Three.js
On the rendering side (src/render/stage/post.ts), SCARECROW SMASHER runs a custom Three.js half-float (RGBA16F) linear-HDR post-processing chain tuned specifically for crowded melee combat:
- Stencil-protected attack warnings: The scene target allocates a stencil buffer so enemy telegraph lines and slam circles stay sharply legible even when straw particles, fire, and hit flashes pile up on top of them.
- Capped bloom + highlight shoulder: Dense combos used to blow out a quarter of the screen into pure white. The composite shader caps bloom contribution (
bloomCap) and rolls off linear values abovekneeHdrtoward a soft ceiling while preserving hue, then applies a twilight-violet/warm-gold dusk grade and ACES filmic tonemapping. - Adaptive antialiasing + edge cues: On high quality at
dpr <= 1, the scene target uses4×MSAA; otherwise the composite pass runs single-pass perceptual-luma HDR FXAA plus a subtle 4-tap sharpen masked away from jagged edges. Low health (< 25%) darkens the outer border of the frame, while FRENZY lights those edges warm—keeping the center55%of the arena completely unobstructed. Devices without half-float support fall back cleanly to an 8-bit render target.
Card families, permanent hero levels, and ten nights
A run lasts about 10 minutes: eight escalating waves followed by the Scarecrow King. Whenever smashing fills the card bar, the game deals three cards from six distinct families (ball, chain, hero, life, smash, combo) with a strict rule that no two cards in an offer share a family—and every ball card you take stacks its traits permanently for that run while letting you swap a bad draw twice (R).
Out of the box, there are 26 base run cards (most upgradeable across multiple levels) plus 6 more unlockable cards in EXTRAS (such as Twin Ball, Anchor, Snap Back, Close Call, Unhurt Frenzy, and Ripe Apples) bought with MERIT earned after wins. Between runs, cleared waves grant XP up to level 30, giving 1 point per level across 5 permanent stats and 18 skills arranged in three boughs (Ball, Guard, and Combo), including active skills starting at level 3. Beating all 10 nights without help unlocks YOUR NIGHT, where you stack custom rules to push your best RISK record.
Try a ten-minute run
If you want to feel how a single-control flail brawler plays when speed is your damage, open SCARECROW SMASHER in your browser—mouse, WASD, arrow keys, or touch all work, with English and Simplified Chinese built in. The game is free, no pay to win, no sign-up, and plays in the browser with nothing to install.
A note on how it was made: the game was built with heavy AI assistance (including Claude Code), directed, tuned, and verified by our team at Ant Games, and this article was also drafted with AI assistance.