diff --git a/assets/_sheet_boyrun.png b/assets/_sheet_boyrun.png index 506f3f0..8dd2c99 100644 Binary files a/assets/_sheet_boyrun.png and b/assets/_sheet_boyrun.png differ diff --git a/assets/_sheet_obounce.png b/assets/_sheet_obounce.png new file mode 100644 index 0000000..ee860ea Binary files /dev/null and b/assets/_sheet_obounce.png differ diff --git a/assets/_sheet_pbounce.png b/assets/_sheet_pbounce.png new file mode 100644 index 0000000..cde054f Binary files /dev/null and b/assets/_sheet_pbounce.png differ diff --git a/assets/o_bounce.png b/assets/o_bounce.png index 584b125..a3dd665 100644 Binary files a/assets/o_bounce.png and b/assets/o_bounce.png differ diff --git a/assets/o_bounce2.png b/assets/o_bounce2.png new file mode 100644 index 0000000..fcaa61a Binary files /dev/null and b/assets/o_bounce2.png differ diff --git a/assets/p_bounce.png b/assets/p_bounce.png index dcc4167..7558d61 100644 Binary files a/assets/p_bounce.png and b/assets/p_bounce.png differ diff --git a/assets/p_bounce2.png b/assets/p_bounce2.png new file mode 100644 index 0000000..f22532a Binary files /dev/null and b/assets/p_bounce2.png differ diff --git a/assets/x_boyrun1.png b/assets/x_boyrun1.png index 5ce103d..7fd1637 100644 Binary files a/assets/x_boyrun1.png and b/assets/x_boyrun1.png differ diff --git a/assets/x_boyrun2.png b/assets/x_boyrun2.png index 67cb41b..6e69454 100644 Binary files a/assets/x_boyrun2.png and b/assets/x_boyrun2.png differ diff --git a/assets/x_boyrun3.png b/assets/x_boyrun3.png new file mode 100644 index 0000000..4e5be4b Binary files /dev/null and b/assets/x_boyrun3.png differ diff --git a/assets/x_boyrun4.png b/assets/x_boyrun4.png new file mode 100644 index 0000000..27b5d47 Binary files /dev/null and b/assets/x_boyrun4.png differ diff --git a/game.js b/game.js index 57a2e50..56f83f8 100644 --- a/game.js +++ b/game.js @@ -206,9 +206,9 @@ function say(text, delay = 0) { // fallback when a recorded umpire line is missi // ---------------------------------------------------------------- sprites ---- // assets/.png; game falls back to code-drawn figures until sprites load. const SPR = {}; -for (const n of ['p_idle1','p_idle2','p_bounce','p_toss','p_smash','p_run1','p_run2','p_swing1','p_swing2', - 'o_idle1','o_idle2','o_bounce','o_toss','o_smash','o_run1','o_run2','o_swing1','o_swing2', - 'x_ump','x_boyrun1','x_boyrun2']) { +for (const n of ['p_idle1','p_idle2','p_bounce','p_bounce2','p_toss','p_smash','p_run1','p_run2','p_swing1','p_swing2', + 'o_idle1','o_idle2','o_bounce','o_bounce2','o_toss','o_smash','o_run1','o_run2','o_swing1','o_swing2', + 'x_ump','x_boyrun1','x_boyrun2','x_boyrun3','x_boyrun4']) { const img = new Image(); img.onload = () => SPR[n] = img; img.src = 'assets/' + n + '.png'; @@ -610,7 +610,7 @@ function drawStatic(name, x, z, hMeters, bob = 0) { ctx.drawImage(img, p.x - w / 2, p.y - h - bob, w, h); } function drawBoy(b) { - const img = SPR[Math.floor(b.runT * 10) % 2 ? 'x_boyrun1' : 'x_boyrun2']; if (!img) return; + const img = SPR['x_boyrun' + (Math.floor(b.runT * 14) % 4 + 1)]; if (!img) return; const p = proj(b.x, 0, b.z); const h = 1.2 * p.s, w = h * img.width / img.height; ctx.fillStyle = 'rgba(0,0,0,0.25)'; @@ -635,7 +635,7 @@ function drawChar(ch) { const pre = ch.side === 'P' ? 'p_' : 'o_'; let name = pre + (Math.floor(idleT * 1.6) % 2 ? 'idle1' : 'idle2'); // idle weight shift if (phase === 'pretoss' && ch.side === score.server && ch.pose === 'idle') - name = pre + (Math.abs(Math.sin(idleT * 3.6)) < 0.5 ? 'bounce' : 'idle1'); // crouch as the ball drops + name = pre + (Math.abs(Math.sin(idleT * 3.6)) > 0.55 ? 'bounce2' : 'bounce'); // hand rises as the ball comes up if (ch.pose === 'run') name = pre + (Math.floor(ch.runT * 9) % 2 ? 'run1' : 'run2'); if (receiverWaiting) name = pre + (sway > 0 ? 'run1' : 'run2'); // split-step shuffle if (ch.pose === 'swing') name = pre + (ch.poseT < 0.15 ? 'swing1' : 'swing2'); @@ -732,7 +732,7 @@ function render() { // server idly bouncing the ball while waiting if (phase === 'pretoss') { const sv = score.server === 'P' ? P : O; - const bx = sv.x - 0.4 * (sv.side === 'P' ? 1 : -1), by = Math.abs(Math.sin(idleT * 3.6)) * 0.55; + const bx = sv.x - 0.4 * (sv.side === 'P' ? 1 : -1), by = Math.abs(Math.sin(idleT * 3.6)) * 0.78; // floor to hand const sh = proj(bx, 0, sv.z); ctx.fillStyle = 'rgba(0,0,0,0.3)'; ctx.beginPath(); ctx.ellipse(sh.x, sh.y, Math.max(1.5, sh.s * 0.08), Math.max(1, sh.s * 0.035), 0, 0, 7); ctx.fill();