Add hidden dev debug console (v0.5.0)

This commit is contained in:
MeatSlicer Developer committed 2026-07-31 08:49:39 +10:00
1 parent b8b5c360f2
commit 3f76998fab
22 files changed
+1161 -57

No files matched your search

+2 -1
View File
@@ -137,7 +137,8 @@ const Sfx = {
const gain = this.ctx.createGain();
const p = G.player;
let pan = 0, distanceGain = 1;
if (pos && p) {
// guard against non-finite coords (e.g. a caller passing { bossKind } with no x/y)
if (pos && p && Number.isFinite(pos.x) && Number.isFinite(pos.y)) {
pan = clamp((pos.x - p.x) / (W / 2), -1, 1) * 0.75;
const maxD = Math.hypot(W, H);
distanceGain = 1 - 0.35 * clamp(dist(pos.x, pos.y, p.x, p.y) / maxD, 0, 1);