Answer the playtest: a net for the lock, and a duel that pays
The hang: I could not reproduce it or pin it on one latch, so this is two things. A root-cause fix — iOS does not guarantee a touchend when you switch apps mid-drag, and the held G.aim it leaves behind blocks the uncaught-toss retoss forever — and a watchdog for whatever else is out there. The watchdog does not time how long you have been blocked, because a horde blocks you for fifteen honest seconds; it watches whether the clock that should release you is moving, and logs the frozen state before letting go. The duel: past about game 20 all four tins sit at wCap and a won duel handed over literally nothing. It falls through to the barrel weapons now. The prize also stops borrowing the praise channel — arriving in the same slot as PERFECT made it read as another compliment. It gets a card with its own icon. The turn into zombie mode was unwatchable because the zoom started ON it, and the curve render applies is zero at t=0, so the camera only arrived half a second after he had changed. It peaks on the turn now, and the swap lands on a hitstop, a flash and a burst so it reads as an event rather than a glitch. Laser down from 0.55 to 0.22 — zap() sums four voices, so its vol was never one voice's level. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
20a742fbf3
commit
a1a8a61422
7 files changed
+130
-17
No files matched your search
+73
-12
@@ -2,7 +2,7 @@
|
||||
|
||||
import { TUNE, UI, BOSS_ART, APPLAUSE_T, EATEN_BURST, EATEN_SUMMARY, COURT, CONTACT, VOLLEY, ZONE_DEPTH, HOME, P_BOUNDS, TOSS, SHOT_DEPTH, POSE_TIME, BOUNCE_IDLE, zombieH, Z_CHEST , WEAPONS, RACK_MAX , BARREL_WEAPONS } from './config.js';
|
||||
import { P, O, ball, score, crowd, G, other, deuceSide, setupPoint, sendBoy, resetState } from './state.js';
|
||||
import { audio, pock, swish, whoosh, applause, voice, sfx, aww, zombieMusic, zombieDuck, menuDuck } from './audio.js';
|
||||
import { audio, pock, swish, whoosh, applause, voice, sfx, aww, zombieMusic, zombieDuck, menuDuck, splat, shriek, boom } from './audio.js';
|
||||
import { axisX, axisZ, takeFlickAim, touchPX, resetInput } from './input.js';
|
||||
import { W } from './render.js'; // runtime-only cycle (render imports gameplay), same pattern as input/zombies
|
||||
import { updateZombies, spawnZombie, spawnRacketZombie, spawnMachine, spawnChapterBoss, zombies, gore, explode, meleeSwipe, extras, parts, pellets, shots, playerGore, eatenBleed, resetZombies , firePellet , spawnBarrel , fireBeam } from './zombies.js';
|
||||
@@ -574,17 +574,32 @@ export function deliverTin() {
|
||||
const cand = TINS[(G.deliveries + k) % TINS.length];
|
||||
if (stock(cand) < TUNE.wCap) { id = cand; G.deliveries += k + 1; break; }
|
||||
}
|
||||
// Every tin full is a real state and it is not a bug, so say so plainly instead of miming a
|
||||
// handover that cannot happen. No boy, no umpire line — nothing was delivered.
|
||||
// ...and when the whole four-rung ladder is capped, PAY OUT OF THE BARREL RACK instead. Past
|
||||
// about game 20 all four tins sit at wCap and the duel — the one thing in the run you play for —
|
||||
// handed you nothing at all: "the duel does not always give you new weapons". The barrel weapons
|
||||
// are the natural next rung, they already exist, and you cannot otherwise win one without
|
||||
// shooting a barrel. Unlocked ones only, so this can never hand you a rocket in game three.
|
||||
if (!id) {
|
||||
const late = Object.keys(BARREL_WEAPONS)
|
||||
.filter(w => G.runGames >= BARREL_WEAPONS[w].from && stock(w) < TUNE.wCap);
|
||||
if (late.length) id = late[G.deliveries++ % late.length];
|
||||
}
|
||||
// Every tin AND every barrel weapon full is a real state and not a bug, so say so plainly instead
|
||||
// of miming a handover that cannot happen. No boy, no umpire line — nothing was delivered.
|
||||
if (!id) { G.flash = { text: 'RACK FULL', t: 1.1 }; return; }
|
||||
const wasPlain = G.weapon === 0 && !G.temp; // never yank you off a deliberate PLAIN (banking)
|
||||
grantWeapon(id);
|
||||
if (wasPlain) G.weapon = 0;
|
||||
sendBoy(); voice('new_balls', 0.6);
|
||||
aside('ump_new_balls_dark', 2.0); // "...and a new opponent, apparently."
|
||||
// From the fifth delivery on, weaponModal has nothing new to explain and stays quiet — so the tin
|
||||
// needs the same free-floating label a barrel already gets, or a won duel pays out in silence.
|
||||
G.flash = { text: WEAPONS[id].label, t: 1.1 };
|
||||
// THE PRIZE GETS ITS OWN CARD, with the tin's own icon on it. It used to borrow G.flash — the
|
||||
// same channel as PERFECT and DOUBLE KILL — so the one thing you played the duel FOR arrived as a
|
||||
// word in the praise slot and read as another compliment. weaponModal still fires the first time
|
||||
// a tin is seen (it has rules to teach); every time after, this card is the announcement, and it
|
||||
// does not want a tap: you have just won a point, not been asked a question.
|
||||
G.card = { title: WEAPONS[id].label, sub1: 'DELIVERED TO THE RACK',
|
||||
sub2: (WEAPONS[id].desc && WEAPONS[id].desc[0]) || '',
|
||||
icon: WEAPONS[id].icon, color: UI.warm, t: TUNE.tinCardT };
|
||||
weaponModal(id);
|
||||
}
|
||||
|
||||
@@ -696,6 +711,38 @@ export function endBossFight() {
|
||||
if (G.afterDuel) { G.afterClear = G.afterDuel; G.afterDuel = null; proceedAfterClear(); }
|
||||
}
|
||||
|
||||
// ---- THE DEADLOCK WATCHDOG.
|
||||
// A run that hard-locks costs the player everything, and this file has form: `mgT` was once left
|
||||
// above zero by a beat that moved the phase underneath it, and `mgT > 0` blocks serving, so the
|
||||
// game sat there with the gun racket on screen. This is the net.
|
||||
//
|
||||
// It cannot misfire on a legitimate wait, and that is the whole design: every legitimate reason you
|
||||
// cannot serve — a horde, a burst, a changeover, the duel's announcement, an 'over' beat — has a
|
||||
// CLOCK counting down toward letting you act. So the test is not "how long has the player been
|
||||
// blocked" (a horde blocks you for fifteen honest seconds); it is "is the thing that should be
|
||||
// releasing me actually moving". If none of those numbers changes for stuckT seconds while the
|
||||
// player is blocked and no popup is waiting on them, the state is dead and nothing will revive it.
|
||||
//
|
||||
// It also LOGS what was frozen, into the same miss log the scoreboard tap already shows — a lock
|
||||
// that unsticks itself and leaves no evidence is worse than one that does not.
|
||||
let stuckT = 0, stuckSig = '';
|
||||
function watchdog(dt) {
|
||||
if (G.mode !== 'splatter' || G.modal) { stuckT = 0; return; } // a popup waits on the PLAYER: legitimate
|
||||
const blocked = G.horde || G.mgT > 0 || G.changeover || G.phase === 'over'
|
||||
|| (G.interlude && G.interlude.introT > 0)
|
||||
|| (G.phase === 'toss' && ball.y < 2.0); // a toss on the floor: only a held aim keeps it there
|
||||
if (!blocked) { stuckT = 0; return; }
|
||||
const sig = [G.horde && G.horde.t, G.mgT, G.changeover, G.interlude && G.interlude.introT,
|
||||
G.phase === 'over' && G.overT, ball.y].map(v => (+v || 0).toFixed(2)).join('|');
|
||||
if (sig !== stuckSig) { stuckSig = sig; stuckT = 0; return; } // something is still moving — fine
|
||||
if ((stuckT += dt) < TUNE.stuckT) return;
|
||||
logSwing({ result: 'UNSTUCK', reason: `nothing moved for ${TUNE.stuckT}s — released a dead latch`,
|
||||
phase: G.phase, sig, aim: !!G.aim });
|
||||
G.horde = null; G.mgT = 0; G.changeover = false; G.interlude = false;
|
||||
G.aim = null; endBurst(); setupPoint();
|
||||
stuckT = 0; stuckSig = '';
|
||||
}
|
||||
|
||||
export function resolveInterlude(side) {
|
||||
if (!G.interlude) return;
|
||||
G.interlude = false;
|
||||
@@ -806,13 +853,26 @@ function transition(dt) {
|
||||
const t = (G.transT += dt);
|
||||
const once = (key, at, fn) => { if (t >= at && !G.tFlags[key]) { G.tFlags[key] = true; fn(); } };
|
||||
once('quiet', 1.8, () => voice('quiet_dark', 0, 0.82));
|
||||
// The turn is the moment the game tells you what it now is, and it used to happen in a wide
|
||||
// static shot at the far baseline where it was three pixels tall. The camera PUNCHES IN on him
|
||||
// for it (a flat 2D zoom, see render), and the ground goes with it. Each later beat shakes harder.
|
||||
// THE CAMERA HAS TO BE THERE BEFORE IT HAPPENS. The zoom used to start ON the turn — and the
|
||||
// curve render applies is `sin(p*PI)`, which is ZERO at p=0, so the punch-in only reached full
|
||||
// magnification half a second AFTER he had already changed. You watched the aftermath every time.
|
||||
// It starts at 1.8 with T 3.2 so the peak (p=0.5) lands exactly on the turn at 3.4, holds through
|
||||
// it, and pulls back out as the mob walks on — which becomes the reveal of what else is coming.
|
||||
once('closein', 1.8, () => { G.zoom = { x: O.x, z: O.z, k: 2.1, t: 0, T: 3.2 }; });
|
||||
// ...and the turn itself is a sprite SWAP, one frame to the next, with nothing to sell it. So it
|
||||
// lands on a beat: the world stops dead for a moment (hitstop), the screen flashes, he comes
|
||||
// apart and puts himself back together wrong. The freeze is what makes a swap read as an EVENT
|
||||
// rather than as a glitch — the eye is given something to blame the change on.
|
||||
once('turn', 3.4, () => {
|
||||
spawnZombie(O.x, O.z, 'c'); G.hideO = true; // the opponent... turns
|
||||
G.zoom = { x: O.x, z: O.z, k: 1.9, t: 0, T: 1.15 };
|
||||
G.shake = { t: 0.45, mag: 4 };
|
||||
G.hitstop = 0.16; // the world holds its breath
|
||||
G.boomFlash = 0.16; G.shake = { t: 0.7, mag: 7 };
|
||||
shriek(); splat(0.9); boom();
|
||||
for (let k = 0; k < 40; k++) parts.push({ // he bursts, and what stands up is not him
|
||||
x: O.x, y: 0.5 + Math.random() * 1.5, z: O.z,
|
||||
vx: (Math.random() * 2 - 1) * 3.5, vy: 1 + Math.random() * 4, vz: (Math.random() * 2 - 1) * 3.5,
|
||||
t: 0.5 + Math.random() * 0.7, dark: Math.random() < 0.45 });
|
||||
gore.push({ x: O.x, z: O.z, r: 1.1, a: 0.9 });
|
||||
spawnZombie(O.x, O.z, 'c'); G.hideO = true; // the opponent... turns
|
||||
});
|
||||
once('mob', 4.8, () => { spawnZombie(-3.5, -1.6, 'a'); spawnZombie(2.5, -2.1, 'b'); G.shake = { t: 0.5, mag: 6 }; });
|
||||
once('seated', 5.4, () => voice('remain_seated', 0, 0.95));
|
||||
@@ -1359,6 +1419,7 @@ export function update(dt) {
|
||||
if (G.mode !== 'tennis') updateZombies(dt);
|
||||
tickTestMode(dt); // keeps the sandbox stocked and rolls it a barrel now and then
|
||||
if (G.meleeT > 0) G.meleeT -= dt;
|
||||
watchdog(dt);
|
||||
if (G.clearing && !zombies.some(blocksClear)) proceedAfterClear(); // the won-game wave is mopped up — advance
|
||||
if (G.mode === 'transition') transition(dt);
|
||||
|
||||
|
||||
Reference in new issue
Block a user