Drill: visible dust; pulses push loose material back and open a channel (t92)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-28 18:32:31 -04:00
co-authored by Claude Opus 5.5
parent 729378770a
commit dadf62a28d
8 changed files with 151 additions and 22 deletions
+16 -2
View File
@@ -331,8 +331,13 @@ function drawBot() {
ctx.beginPath(); ctx.moveTo(cx - bot.face * zp, sy + zp * 0.6 + bob); ctx.lineTo(cx - bot.face * zp * 1.6, sy - zp * 0.6 + bob); ctx.stroke();
ctx.restore();
}
function spawnDebris(x, y, m) {
function spawnDebris(x, y, m, dust = false) {
if (!SET.particles || R.particles.length > 400) return;
if (dust) {
R.particles.push({ x: x + 0.5, y: y + 0.5, vx: (Math.random() - 0.5) * 0.12,
vy: -0.06 - Math.random() * 0.06, life: 36, r: 205, g: 190, b: 165, dust: true });
return;
}
for (let k = 0; k < 2; k++) R.particles.push({ x: x + Math.random(), y: y + Math.random(), vx: (Math.random() - 0.5) * 0.5, vy: -Math.random() * 0.5, life: 20 + Math.random() * 20, r: COLR[m], g: COLG[m], b: COLB[m] });
}
function spawnSpark(x, y) {
@@ -358,11 +363,20 @@ function drawParticles() {
p.x += dx / d * sp; p.y += dy / d * sp; p.life--;
if (p.life <= 0) { ps.splice(k, 1); continue; }
} else {
p.x += p.vx; p.y += p.vy; p.vy += 0.04; p.life--;
p.x += p.vx; p.y += p.vy; p.vy += p.dust ? 0 : 0.04; p.life--;
if (p.life <= 0) { ps.splice(k, 1); continue; }
}
if (SET.fog && fogSeen(p.x, p.y) < 64) continue;
const s = worldToScreenPx(p.x, p.y);
if (p.dust) {
const radius = zp * (1 + (36 - p.life) * 0.035);
const puff = ctx.createRadialGradient(s.x, s.y, 0, s.x, s.y, radius);
puff.addColorStop(0, `rgba(${p.r},${p.g},${p.b},${0.32 * p.life / 36})`);
puff.addColorStop(1, `rgba(${p.r},${p.g},${p.b},0)`);
ctx.fillStyle = puff;
ctx.fillRect(s.x - radius, s.y - radius, radius * 2, radius * 2);
continue;
}
ctx.fillStyle = `rgba(${p.r | 0},${p.g | 0},${p.b | 0},${Math.min(1, p.life / 10)})`;
const sz = p.spark ? Math.max(1, zp * 0.5) : p.suck ? zp : Math.max(1, zp * 0.7);
ctx.fillRect(s.x, s.y, sz, sz);