The host names the stakes: classic tennis, or the death match
Three chips under VS A FRIEND — the host's pick rides the room and the start message rebuilds both courts on pairing. In the death match your opponent IS the zombie: their lost points tear its wound stages, their won points draw your blood, and bleeding out crosses the wire as the other phone's win. The same receiver-is-judge verdicts drive the match machinery through resolveInterlude, so the fall, the mop beat and the burst come along unmodified. New: gushProne — the game-winning body bleeds out on the ground, from prone-height anchors, until it bursts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5e80c4e69d
commit
c0b59eee90
10 files changed
+241
-26
No files matched your search
+15
-7
@@ -7,7 +7,7 @@ import { TUNE, COURTS, TOURS, MODES, MENU, DIFFS, EATEN_RESTART, DONE_RESTART, W
|
||||
import { P, O, ball, score, G, setupPoint, selectCourt, selectTour } from './state.js';
|
||||
import { update, restartRun, keyPressed, solveShot, inServeBox, inCourt, forceZombies, splatPoint, deliverTin, selectWeapon, grantWeapon, showModal, dismissModal, flickTarget, dragServe, toggleTestMode } from './gameplay.js';
|
||||
import { startDuel, resolveInterlude, startBossFight, endBossFight, startDrill, endDrill, startMatch, endMatch, startBench, endBench, FALL, benchFall, startNetVs } from './beats.js';
|
||||
import { netConnect } from './net.js';
|
||||
import { netConnect, netHooks } from './net.js';
|
||||
import { fitViewport, render, proj, RES, SPRV, LOAD, SPR } from './render.js';
|
||||
import { voice, ambient, menuMusic, menuDuck } from './audio.js';
|
||||
import { zombies, spawnZombie, spawnRacketZombie, spawnMachine, spawnChapterBoss, piles, gore, parts, pellets, extras, shots, pops, explode, hurtPlayer, killPlayer , spawnBarrel } from './zombies.js';
|
||||
@@ -104,7 +104,9 @@ const pickMode = id => { pickedMode = id; try { localStorage.setItem('mode', id)
|
||||
// setup screen (court and tour ride whatever was last picked). HOST shows the code to share in a
|
||||
// modal over the frozen court; JOIN asks for a friend's code.
|
||||
// ponytail: prompt() is the join UI — replace with a drawn code entry if the mode ships.
|
||||
function netChip(label, join) {
|
||||
// The host's one decision — classic or the death match — rides the room, so the joiner never picks
|
||||
// a mode: the start message carries it to both phones and both courts are rebuilt on pairing.
|
||||
function netChip(label, join, death = false) {
|
||||
const b = document.createElement('button');
|
||||
b.className = 'chip';
|
||||
b.textContent = label;
|
||||
@@ -114,8 +116,8 @@ function netChip(label, join) {
|
||||
code = (prompt('ROOM CODE FROM YOUR OPPONENT') || '').trim().toUpperCase();
|
||||
if (!code) return;
|
||||
}
|
||||
start('classic');
|
||||
if (startNetVs()) netConnect(code);
|
||||
start('classic'); // the waiting court is classic either way; a death room swaps it on pairing
|
||||
if (startNetVs()) netConnect(code, death);
|
||||
});
|
||||
return b;
|
||||
}
|
||||
@@ -125,7 +127,8 @@ function buildSub(top) {
|
||||
const t = top || topOf(pickedMode);
|
||||
document.getElementById('subTitle').textContent = t.diffs ? 'DIFFICULTY' : (t.name || '');
|
||||
if (t.net) {
|
||||
modeSub.appendChild(netChip('HOST — GET A ROOM CODE', false));
|
||||
modeSub.appendChild(netChip('HOST — CLASSIC TENNIS', false));
|
||||
modeSub.appendChild(netChip('HOST — DEATH MATCH', false, true));
|
||||
modeSub.appendChild(netChip('JOIN WITH A CODE', true));
|
||||
return;
|
||||
}
|
||||
@@ -363,6 +366,7 @@ function intoSplatter() {
|
||||
zombies.length = 0; shots.length = 0; pellets.length = 0;
|
||||
score.server = 'P'; setupPoint();
|
||||
}
|
||||
netHooks.intoSplatter = intoSplatter; // netplay's death match enters splatter through the same hack
|
||||
document.getElementById('scWeapons').addEventListener('click', () => {
|
||||
start(null); intoSplatter(); toggleTestMode();
|
||||
});
|
||||
@@ -583,8 +587,12 @@ if (location.hash === '#drill') setTimeout(() => { start(null); intoSplatter();
|
||||
if (location.hash === '#match') setTimeout(() => { start(null); intoSplatter(); startMatch(); }, 700);
|
||||
if (location.hash === '#cup') setTimeout(() => { start(null); intoSplatter(); startMatch(true); }, 700);
|
||||
if (location.hash === '#bench') setTimeout(() => { start(null); intoSplatter(); startBench(); }, 700);
|
||||
// #net hosts a room, #net-ABCD joins one — the netplay door from a URL (slice(5) skips '#net-')
|
||||
if (location.hash.startsWith('#net')) setTimeout(() => {
|
||||
// #net hosts classic, #netd hosts a death match, #net-ABCD joins — the netplay doors from a URL
|
||||
if (location.hash === '#netd') setTimeout(() => {
|
||||
start('classic');
|
||||
if (startNetVs()) netConnect(null, true);
|
||||
}, 700);
|
||||
else if (location.hash.startsWith('#net')) setTimeout(() => {
|
||||
start('classic');
|
||||
if (startNetVs()) netConnect(location.hash.slice(5).toUpperCase() || null);
|
||||
}, 700);
|
||||
|
||||
Reference in new issue
Block a user