Sweep the dead code off the court
EATEN_GRAB (write-only marker), ball.firstLand (written five places, read nowhere), zombies' unused VOLLEY import, three scoreboard palette fields from the pre-PNG board, the x_tin.png nothing references, and a dozen export keywords on functions no module ever imported. Kept on purpose: o_run3/o_run4.png — the SPR list excludes them so both tours run on two frames (the women's set has no 3/4 twins), per the comment at the preload list. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e07196f247
commit
d847c2e4a8
7 files changed
+23
-24
No files matched your search
+10
-11
@@ -29,11 +29,11 @@ export function predictLanding() { // first-bounce point, closed form — exact,
|
||||
// further, which is the whole fix: a shambler at the far baseline costs the same short pull as
|
||||
// one on top of you, so the gesture always fits on the screen. The first body standing in the
|
||||
// lane is the target; the cone widens with range so distant lanes stay pickable.
|
||||
export const pullFrac = mag => Math.max(0, Math.min(1, (mag - TUNE.pullMin) / (TUNE.pullFull - TUNE.pullMin)));
|
||||
const pullFrac = mag => Math.max(0, Math.min(1, (mag - TUNE.pullMin) / (TUNE.pullFull - TUNE.pullMin)));
|
||||
export const pullQuality = mag => TUNE.pullQMin + pullFrac(mag) * (1 - TUNE.pullQMin);
|
||||
// pullQuality inverted: hitServe is handed a quality, not a drag, and the band it leaves behind is
|
||||
// drawn at the same weight the live preview had.
|
||||
export const qualityFrac = q => Math.max(0, Math.min(1, (q - TUNE.pullQMin) / (1 - TUNE.pullQMin)));
|
||||
const qualityFrac = q => Math.max(0, Math.min(1, (q - TUNE.pullQMin) / (1 - TUNE.pullQMin)));
|
||||
// A pull that STOPS in the band at the top of the draw, rather than merely reaching it. See
|
||||
// TUNE.perfectBand for why the old "quality == 1" test praised almost every serve.
|
||||
export const pullPerfect = mag => mag >= TUNE.pullFull && mag <= TUNE.pullFull * TUNE.perfectBand;
|
||||
@@ -139,7 +139,7 @@ function doHit(ch, quality, aim) {
|
||||
}
|
||||
ball.g = g;
|
||||
ball.vx = v.vx; ball.vy = v.vy; ball.vz = v.vz;
|
||||
ball.lastHit = ch.side; ball.bounces = 0; ball.firstLand = null;
|
||||
ball.lastHit = ch.side; ball.bounces = 0;
|
||||
G.wasServe = false; // a serve volleyed back pre-bounce must not fault-check the return
|
||||
ball.pow = quality; // carried pace: zombies splatter only above zSplatQ
|
||||
ball.kills = 0; // fresh shot: multi-kill streak restarts
|
||||
@@ -162,7 +162,7 @@ function doHit(ch, quality, aim) {
|
||||
|
||||
// ----------------------------------------------------------------- serve ----
|
||||
function tossBall(sv) {
|
||||
ball.active = true; ball.bounces = 0; ball.firstLand = null; ball.collected = false;
|
||||
ball.active = true; ball.bounces = 0; ball.collected = false;
|
||||
// The player is right-handed: he tosses with his LEFT hand (viewer's left) and hits with the
|
||||
// racket on the viewer's right, so the ball goes up almost over his head — a big offset either way
|
||||
// lands it on the wrong side of one of those two frames. The opponent is drawn from the front and
|
||||
@@ -171,7 +171,7 @@ function tossBall(sv) {
|
||||
ball.vx = 0; ball.vz = 0; ball.vy = TOSS.vy; ball.g = TUNE.gravity;
|
||||
G.phase = 'toss';
|
||||
}
|
||||
export function serveApexY() { return TOSS.y0 + TOSS.vy * TOSS.vy / (2 * TUNE.gravity); } // ~2.95
|
||||
function serveApexY() { return TOSS.y0 + TOSS.vy * TOSS.vy / (2 * TUNE.gravity); } // ~2.95
|
||||
|
||||
// how many 10%-pace cuts a shot may take to get over the net. 8 wasn't enough for a target
|
||||
// sitting right behind the tape — that needs a near-vertical drop, so ~10 cuts (pace × 0.35).
|
||||
@@ -522,10 +522,10 @@ function startChangeover() {
|
||||
// that ("[0,1,2,3,4].find(...)"), so the moment the rack grew past five, a burst weapon sitting in
|
||||
// slot 5..9 could never be found and never spent: beacon, flamer and rocket sat at their pickup
|
||||
// count forever. One accessor, one place that knows the range.
|
||||
export const slotEntry = i => (i === 0 ? G.temp : G.rack[i - 1]) || null;
|
||||
const slotEntry = i => (i === 0 ? G.temp : G.rack[i - 1]) || null;
|
||||
export const slotId = i => slotEntry(i)?.id || (i === 0 ? 'ball' : null);
|
||||
export const slotStock = i => { const e = slotEntry(i); return e ? e.n : (i === 0 ? Infinity : 0); };
|
||||
export const slotOf = id => { // -1 if you are not carrying it
|
||||
const slotOf = id => { // -1 if you are not carrying it
|
||||
for (let i = 0; i <= RACK_MAX; i++) if (slotId(i) === id) return i;
|
||||
return -1;
|
||||
};
|
||||
@@ -549,7 +549,7 @@ export function grantWeapon(id, n = WEAPONS[id].tin) {
|
||||
|
||||
// Spend one from a slot, and hand you back plain balls when it runs dry. The temp weapon does not
|
||||
// leave an empty dimmed slot behind the way a rack entry does — slot 0 simply becomes BALL again.
|
||||
export function spendSlot(i) {
|
||||
function spendSlot(i) {
|
||||
const e = slotEntry(i);
|
||||
if (!e) return;
|
||||
if (--e.n > 0) return;
|
||||
@@ -646,7 +646,7 @@ function stockTestRack() {
|
||||
else if (G.rack.length < RACK_MAX) G.rack.push({ id, n: WEAPONS[id].tin });
|
||||
}
|
||||
}
|
||||
export function tickTestMode(dt) {
|
||||
function tickTestMode(dt) {
|
||||
if (!G.testMode) return;
|
||||
stockTestRack(); // no barrels: the rack is already full of everything they would hand you, and
|
||||
} // one rolling across the sandbox was just something else to look at
|
||||
@@ -934,7 +934,6 @@ function onBounce() {
|
||||
}
|
||||
if (G.mode !== 'tennis') return; // no lines, no faults — the umpire has other concerns
|
||||
if (ball.bounces === 1) {
|
||||
ball.firstLand = { x: ball.x, z: ball.z };
|
||||
const wasServe = G.wasServe; G.wasServe = false;
|
||||
if (wasServe) {
|
||||
if (!inServeBox(ball.x, ball.z)) { ball.active = false; fault(); }
|
||||
@@ -1156,7 +1155,7 @@ export function dragServe(aim) {
|
||||
// walked the player around between shots was the confusing part, not the fire rate.
|
||||
if (ball.active && G.phase !== 'toss') // the old ball flies on as a ballistic clone
|
||||
extras.push({ x: ball.x, y: ball.y, z: ball.z, vx: ball.vx, vy: ball.vy, vz: ball.vz, pow: ball.pow || 0.5, t: 2.5, g: ball.g, wid: ball.wid });
|
||||
ball.active = true; ball.collected = false; ball.bounces = 0; ball.firstLand = null;
|
||||
ball.active = true; ball.collected = false; ball.bounces = 0;
|
||||
ball.x = P.x + 0.12; ball.z = P.z; ball.y = 2.2; ball.g = TUNE.gravity; // over his head, see tossBall
|
||||
// a full pull is quality 1.0, but only a pull that STOPS at the top of the draw is praised
|
||||
hitServe(P, pullQuality(aim.mag), aim, pullPerfect(aim.mag));
|
||||
|
||||
Reference in new issue
Block a user