This commit is contained in:
33333-33333 2026-06-24 18:49:17 +09:00
commit d875df8600
22 changed files with 625 additions and 496 deletions

View file

@ -400,23 +400,20 @@
const result = repairPoint(ef, ef.size || 12);
if (result === "delete") ef.life = 0;
}
const safeW = Math.max(pad * 2 + 1, Number(this.w || 1000) || 1000);
const safeH = Math.max(pad * 2 + 1, Number(this.h || 720) || 720);
const repairTarinai = (t) => {
t.x = clamp(Number.isFinite(t.x) ? t.x : safeW * 0.5, pad, safeW - pad);
t.y = clamp(Number.isFinite(t.y) ? t.y : safeH * 0.5, pad, safeH - pad);
t.vx = 0;
t.vy = 0;
t.entryTimer = 0;
t.lastOutOfBoundsRepairAt = this.time || 0;
};
for (const t of this.tarinai || []) {
if (!t || t.dead) continue;
const result = repairPoint(t, t.radius || 22);
if (result === "delete") {
t.x = clamp(Number.isFinite(t.x) ? t.x : this.w * 0.5, pad, this.w - pad);
t.y = clamp(Number.isFinite(t.y) ? t.y : this.h * 0.5, pad, this.h - pad);
t.vx = 0;
t.vy = 0;
t.entryTimer = 0;
t.die(HEALTH?.CAUSES?.outOfBounds || "\u4ed5\u69d8\u306b\u3088\u308a\u753b\u9762\u5916\u3067\u524a\u9664");
} else if (result === "moved") {
t.x = clamp(Number.isFinite(t.x) ? t.x : this.w * 0.5, pad, this.w - pad);
t.y = clamp(Number.isFinite(t.y) ? t.y : this.h * 0.5, pad, this.h - pad);
t.vx = 0;
t.vy = 0;
t.entryTimer = 0;
}
if (result === "delete" || result === "moved") repairTarinai(t);
}
let changedAnts = false;
for (const ant of this.ants || []) {