Winning your 2nd splatter game (G.splatGames) — or triple-tapping the
umpire in splatter (forceZombies now calls startHorde) — launches a 12s
horde (TUNE.hordeLen). During a horde: the match ball is gone and taps do
nothing; the racket auto-fires pellets straight up-court at TUNE.mgRate
(6/s, ±4° spread, 26 m/s, flat, 1.2s life) and the thumb DRAG steers you
(auto-assist disabled). Zombies pour in at TUNE.hordeRate (2.5/s) from the
far baseline and the sides, ignoring zMax; the speed ramp still applies.
Pellets live in a new zombies.js `pellets` array, kill on contact (always
splatter-quality). splatter() gains a fanfare flag — pellet kills make
gore/piles/points but skip the multi-kill streak so a horde doesn't spam
MASSACRE. splatPoint() gains a quiet flag: during a horde the umpire only
calls a score every >2s (game-win lines always speak); the HUD score keeps
ticking. Horde ends → setupPoint() resumes serving, voice('quiet_dark');
leftover zombies stay for you to mop up. Eaten stays lethal during hordes
(a zombie reaching you ends it and clears the swarm). Pellets render as
2×2 yellow tracers with a ground shadow; serve prompt suppressed while
G.horde. window.T exposes pellets + forceZombies.
NOTE for Oliver: per spec every game won after the 2nd triggers a horde,
and games won by the machine gun mid-horde count too, so play gets very
horde-heavy after game 2 — flag if you want a cooldown or a knob.
Verified via window.T: cheat + 2nd-game both launch the horde (1st does
not); ~29 spawns over exactly 12s; pellets stream (7 in flight) and clear
a lane, building piles/gore; 4 points scored but the umpire speaks once
(rate-limited); horde ends cleanly back to pretoss; eaten still fires
mid-horde; regression ladder green — tennis 11/12, Phase 1 flick-serve,
Phase 2 DOUBLE→TRIPLE, Phase 4 MASSACRE ×4; no console errors.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
76 lines
3.8 KiB
JavaScript
76 lines
3.8 KiB
JavaScript
// All tuning and constants. TUNE is live-editable in game via the T panel;
|
|
// the exported consts below are structural values that code shares but the panel doesn't show.
|
|
|
|
export const TUNE = {
|
|
camZ: 36, camY: 9, camF: 280, horizon: 40,
|
|
gravity: 9.2, // slightly floaty vs 9.8 for readability
|
|
spinFactor: 0.9, // extra dive on quality shots (fake topspin)
|
|
bounceY: 0.58, bounceXZ: 0.78,
|
|
playerSpeed: 5.4, aiSpeed: 4.3,
|
|
reach: 1.3, aiReach: 1.6, // tight contact radius: the assist positions you, the tap must be honest
|
|
swingWindup: 0.06, // s before contact window opens
|
|
swingWindow: 0.16, // s contact window length
|
|
baseShotSpeed: 16, qualityShotSpeed: 12, // horizontal m/s = base + q*quality; perfect timing = real pace
|
|
serveSpeed: 21, serveQualitySpeed: 7,
|
|
aimError: 2.4, // m of scatter at quality 0
|
|
perfectMs: 45, // |offset from window center| for PERFECT
|
|
aiQualityMin: 0.45, aiQualityMax: 0.85, aiFlub: 0.09,
|
|
aiReaction: 0.45, // s before the CPU reads your shot — well-aimed corners are winners
|
|
autoAssist: matchMedia('(pointer: coarse)').matches ? 1.15 : 0, // auto-run speed factor (mobile)
|
|
zSpeed: 0.7, // zombie shamble speed m/s
|
|
zSpawnEvery: 2.6, // s between spawns
|
|
zMax: 6, // shamblers on court at once
|
|
zSplatQ: 0.5, // min shot quality to splatter; below = stagger pushback
|
|
zPushback: 1.4, // m a staggered zombie is knocked back
|
|
splatterOverT: 0.1, // s the spent-ball 'over' beat lasts before the next serve is armed
|
|
zPierce: 0.75, // pace a ball keeps after a splatter — hot balls plow through lined-up pairs
|
|
bombEvery: 8, // splatter kills between bomb-ball rewards
|
|
bombMax: 3, // bomb balls you can stock at once
|
|
bombRadius: 2.5, // m blast radius of a bomb ball
|
|
hordeLen: 12, // s a horde wave lasts
|
|
hordeRate: 2.5, // zombies spawned per second during a horde
|
|
mgRate: 6, // machine-gun pellets fired per second during a horde
|
|
missHud: 1, // show the last miss reason on screen (full log: T.G.missLog)
|
|
};
|
|
|
|
export const COURT = { L: 23.77, W: 8.23, dblW: 10.97, netZ: 11.885, netH: 0.914, netW: 10.06 };
|
|
COURT.svcFar = COURT.netZ - 6.4; // far service line
|
|
COURT.svcNear = COURT.netZ + 6.4; // near service line
|
|
|
|
// world sizes (meters)
|
|
export const PLAYER_H = 1.88;
|
|
export const BOY_H = 1.2;
|
|
export const UMP_H = 3.0;
|
|
|
|
// contact rules: outside this height band the ball can't be hit (below = it's past you)
|
|
export const CONTACT = { minY: 0.24, maxY: 2.3 };
|
|
|
|
// volleys (pre-bounce contact) get extra forgiveness: the ball passes at full speed and
|
|
// there's no bounce cue to time against, so reach and swing window widen by these factors
|
|
export const VOLLEY = { reach: 1.4, window: 1.8 };
|
|
|
|
// how deep from the far/near baseline a player's interception zone extends
|
|
export const ZONE_DEPTH = 9.5;
|
|
|
|
// recovery positions between shots
|
|
export const HOME = { P: { x: 0, z: 22.8 }, O: { x: 0, z: 2.5 } };
|
|
|
|
// where the near player is allowed to move
|
|
export const P_BOUNDS = { x: 6.5, zMin: COURT.netZ + 1.2, zMax: 26 };
|
|
|
|
// serve toss: release height and upward speed (apex derives from these + gravity)
|
|
export const TOSS = { y0: 1.8, vy: 4.6 };
|
|
|
|
// shot target depth from the receiving baseline, by aim (up = deep, none = mid, down = short)
|
|
export const SHOT_DEPTH = { deep: 3.0, mid: 5.4, short: 8.6 };
|
|
|
|
// how long swing/serve poses hold before returning to idle (s)
|
|
export const POSE_TIME = 0.38;
|
|
|
|
// the server's idle ball bounce: sideways offset to the free hand, apex height, tempo.
|
|
// tempo drives the ball, the hand sprite AND the pock sound — one value, always in sync.
|
|
export const BOUNCE_IDLE = { dx: 0.5, apex: 0.55, tempo: 3.6 };
|
|
|
|
// generated sprite sheets: the idle pose is this many pixels tall; all scales derive from it
|
|
export const SPRITE_H = 112;
|