Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

arena: drive lava animation from sim clock, not paint time

Added a simTime accumulator incremented each sim tick at SIM_HZ, and
switched the lava stripe animation to read from it instead of
performance.now() inside paint. Lava flow is now FPS-independent — same
speed on 30fps and 120fps hardware — and slots with the existing
principle (already true for speed tracking, walkPhase, death ticks, etc.)
that gameplay timing belongs in sim.

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

+15 -1
+15 -1
system/public/aesthetic.computer/disks/arena.mjs
··· 129 129 let speedSmoothed = 0; 130 130 const SPEED_SMOOTH = 0.15; 131 131 132 + // 🕐 Sim-driven clock (seconds). Incremented each sim tick so every 133 + // gameplay-visible animation advances at a constant rate regardless of 134 + // paint FPS. Paint reads this instead of performance.now() for anything 135 + // that should feel tied to the simulation (lava flow, body bob timing in 136 + // the future, etc.). 137 + let simTime = 0; 138 + 132 139 // FPS tracking 133 140 let frameTimes = []; 134 141 let lastFrameTime = 0; ··· 623 630 const cam = doll?.cam; 624 631 if (!cam) return; 625 632 633 + // Advance the sim clock first so any logic below that wants elapsed 634 + // time sees the fresh value. 635 + simTime += 1 / SIM_HZ; 636 + 626 637 // 📱 Update mobile button states 627 638 if (mobileButtons && doll) { 628 639 for (const [name, btnData] of Object.entries(mobileButtons)) { ··· 953 964 // dark skirt that seals any tile-seam gaps, then the ground, its glowing 954 965 // edge, tile highlights, feet shadow + body. 955 966 wipe(45, 48, 55); 956 - const lava = buildLavaFloor(now / 1000); 967 + // Drive lava animation from the sim clock, not paint time — decouples 968 + // the flow speed from render FPS so the look is identical on 30fps and 969 + // 120fps devices. 970 + const lava = buildLavaFloor(simTime); 957 971 if (lava) ink(255).form(lava); 958 972 if (platformBlock) ink(255).form(platformBlock); // bottom and side faces 959 973 if (groundSkirt) ink(255).form(groundSkirt);