Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

arena: wheel zoom between 1P and discrete 3P distances

Scroll up = zoom in (toward 1P). Scroll down = zoom out (pulls camera
back through 3P distances 3, 5, 8, 12). Middle-click still toggles
between 1P and a default 3P level. POV HUD label now shows the active
zoom distance, e.g. "3P ×5".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+28 -3
+28 -3
system/public/aesthetic.computer/disks/arena.mjs
··· 61 61 const PERF_HIGH_MS = 14; // above ~70fps → return to HIGH 62 62 let perfSamplesSinceSwitch = 0; 63 63 64 + // 🔎 Camera zoom — wheel scroll steps between 1P and 3P at discrete distances. 65 + // Level 0 = first person. Levels 1..N = third person, pulling the camera back 66 + // further each click. Middle-mouse still toggles between 1P and a default 3P. 67 + const ZOOM_DISTANCES = [0, 3, 5, 8, 12]; 68 + let zoomLevel = 0; 69 + 70 + function applyZoom(doll) { 71 + if (!doll) return; 72 + const d = ZOOM_DISTANCES[zoomLevel]; 73 + if (zoomLevel === 0) doll.setThirdPerson(false); 74 + else doll.setThirdPerson(true, d); 75 + } 76 + 64 77 function tileKey(row, col) { return row * GRID + col; } 65 78 function tileFromKey(k) { return { row: Math.floor(k / GRID), col: k % GRID }; } 66 79 ··· 763 776 margin + lineH * 4, 764 777 ); 765 778 766 - // POV indicator — 1P or 3P (middle-mouse toggles). 779 + // POV indicator — shows 1P or 3P plus the current zoom distance. 767 780 ink(phys.thirdPerson ? "magenta" : "cyan"); 768 - rightLabel(phys.thirdPerson ? "3P" : "1P", margin + lineH * 5); 781 + const povStr = phys.thirdPerson 782 + ? `3P ×${ZOOM_DISTANCES[zoomLevel]}` 783 + : "1P"; 784 + rightLabel(povStr, margin + lineH * 5); 769 785 } 770 786 771 787 // ⚡ Perf mode label — shows which adaptive-quality tier is active. Flashes ··· 839 855 // 🎥 Middle-mouse toggles third-person (press once to enter, press again 840 856 // to exit). Only trigger on touch so the release doesn't also flip. 841 857 if (e.device === "mouse" && e.button === 1 && e.is("touch")) { 842 - system?.fps?.doll?.toggleThirdPerson?.(); 858 + zoomLevel = zoomLevel === 0 ? 2 : 0; // flip between 1P and default 3P 859 + applyZoom(system?.fps?.doll); 860 + } 861 + 862 + // 🔎 Scroll wheel — steps through discrete zoom levels (1P → closer 3P → 863 + // further 3P). dir > 0 = zoom in (toward 1P); dir < 0 = zoom out. 864 + if (e.is("wheel")) { 865 + if (e.dir > 0) zoomLevel = Math.max(0, zoomLevel - 1); 866 + else if (e.dir < 0) zoomLevel = Math.min(ZOOM_DISTANCES.length - 1, zoomLevel + 1); 867 + applyZoom(system?.fps?.doll); 843 868 } 844 869 845 870 // While dead, any touch respawns; otherwise the first touch re-locks the pen.