Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

dumduel: louder sounds, one bullet at a time, fire only while stopped

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

+12 -8
+12 -8
system/public/aesthetic.computer/disks/dumduel.mjs
··· 97 97 phase = "fight"; 98 98 if (isDueling() && !me) spawnDuelists(); 99 99 // Fight start sound — short rising tone 100 - synth?.({ type: "square", tone: 440, volume: 0.15, attack: 0.01, decay: 0.15, duration: 0.2 }); 100 + synth?.({ type: "square", tone: 440, volume: 0.7, attack: 0.01, decay: 0.15, duration: 0.2 }); 101 101 } 102 102 103 103 function endRound(winnerHandle) { ··· 107 107 // Death sound 108 108 const won = winnerHandle === myHandle; 109 109 if (won) { 110 - synth?.({ type: "triangle", tone: 660, volume: 0.2, attack: 0.01, decay: 0.3, duration: 0.35 }); 110 + synth?.({ type: "triangle", tone: 660, volume: 0.8, attack: 0.01, decay: 0.3, duration: 0.35 }); 111 111 } else { 112 - synth?.({ type: "sawtooth", tone: 120, volume: 0.15, attack: 0.01, decay: 0.4, duration: 0.5 }); 112 + synth?.({ type: "sawtooth", tone: 120, volume: 0.6, attack: 0.01, decay: 0.4, duration: 0.5 }); 113 113 } 114 114 } 115 115 ··· 257 257 countdownTimer--; 258 258 // Tick each second 259 259 if (countdownTimer > 0 && countdownTimer % 60 === 0) { 260 - synth?.({ type: "sine", tone: 330, volume: 0.1, attack: 0.005, decay: 0.1, duration: 0.12 }); 260 + synth?.({ type: "sine", tone: 330, volume: 0.5, attack: 0.005, decay: 0.1, duration: 0.12 }); 261 261 } 262 262 if (countdownTimer <= 0) startFight(); 263 263 } ··· 286 286 opponent.x += (odx / dist) * MOVE_SPEED * 0.7; 287 287 opponent.y += (ody / dist) * MOVE_SPEED * 0.7; 288 288 } 289 - if (opponent.fireTimer <= 0) { 289 + const dummyMoving = Math.abs(opponent.targetX - opponent.x) > 2 || Math.abs(opponent.targetY - opponent.y) > 2; 290 + const theirBulletOut = bullets.some((b) => b.owner === "them"); 291 + if (opponent.fireTimer <= 0 && !dummyMoving && !theirBulletOut) { 290 292 opponent.fireTimer = FIRE_INTERVAL; 291 293 const { nx, ny } = norm(me.x - opponent.x, me.y - opponent.y); 292 294 bullets.push({ ··· 319 321 } 320 322 } 321 323 322 - // Auto-fire toward opponent 324 + // Auto-fire toward opponent (one bullet at a time) 323 325 if (me.alive) { 324 326 me.fireTimer--; 325 - if (me.fireTimer <= 0 && opponent) { 327 + const myBulletOut = bullets.some((b) => b.owner === "me"); 328 + const meMoving = Math.abs(me.targetX - me.x) > 2 || Math.abs(me.targetY - me.y) > 2; 329 + if (me.fireTimer <= 0 && opponent && !myBulletOut && !meMoving) { 326 330 me.fireTimer = FIRE_INTERVAL; 327 331 const { nx, ny } = norm(opponent.x - me.x, opponent.y - me.y); 328 332 const bx = me.x + nx * 6; 329 333 const by = me.y + ny * 6; 330 334 bullets.push({ x: bx, y: by, vx: nx * BULLET_SPEED, vy: ny * BULLET_SPEED, owner: "me" }); 331 - synth?.({ type: "square", tone: 800, volume: 0.06, attack: 0.001, decay: 0.06, duration: 0.07 }); 335 + synth?.({ type: "square", tone: 800, volume: 0.35, attack: 0.001, decay: 0.06, duration: 0.07 }); 332 336 server?.send("duel:fire", { 333 337 handle: myHandle, x: bx, y: by, vx: nx * BULLET_SPEED, vy: ny * BULLET_SPEED, 334 338 });