Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

feat: allow multiple bullets per player in dumduel + remove debug

Removed the hasBullet gate so each stop fires a new bullet.
Removed debug overlays and bullet count display.

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

+17 -32
+14 -21
session-server/duel-manager.mjs
··· 443 443 444 444 // Fire when transitioning from moving to stopped 445 445 if (p.wasMoving && !isMoving) { 446 - // Check no bullet already in flight 447 - const hasBullet = this.bullets.some((b) => b.ownerHandle === h); 448 - if (!hasBullet) { 449 - // Find opponent 450 - const opHandle = duelists.find((d) => d !== h); 451 - const op = opHandle ? this.players.get(opHandle) : null; 452 - if (op && op.alive) { 453 - const { nx, ny } = norm(op.x - p.x, op.y - p.y); 454 - this.bullets.push({ 455 - x: p.x + nx * 6, 456 - y: p.y + ny * 6, 457 - vx: nx * BULLET_SPEED, 458 - vy: ny * BULLET_SPEED, 459 - ownerHandle: h, 460 - age: 0, 461 - }); 462 - console.log(`🎯 ${h} fired! bullets=${this.bullets.length}`); 463 - // Immediately broadcast so client sees the bullet ASAP 464 - // (don't wait for next SNAPSHOT_INTERVAL tick) 465 - this.broadcastSnapshot(); 466 - } 446 + const opHandle = duelists.find((d) => d !== h); 447 + const op = opHandle ? this.players.get(opHandle) : null; 448 + if (op && op.alive) { 449 + const { nx, ny } = norm(op.x - p.x, op.y - p.y); 450 + this.bullets.push({ 451 + x: p.x + nx * 6, 452 + y: p.y + ny * 6, 453 + vx: nx * BULLET_SPEED, 454 + vy: ny * BULLET_SPEED, 455 + ownerHandle: h, 456 + age: 0, 457 + }); 458 + console.log(`🎯 ${h} fired! bullets=${this.bullets.length}`); 459 + this.broadcastSnapshot(); 467 460 } 468 461 } 469 462
+3 -11
system/public/aesthetic.computer/disks/dumduel.mjs
··· 213 213 } 214 214 215 215 // Optimistic fire sound (predict when we stop) 216 - if (localWasMoving && !isMoving && snap) { 217 - const myBulletOut = snap.bullets?.some((b) => b.owner === myHandle); 218 - if (!myBulletOut) { 219 - synth?.({ type: "square", tone: 800, volume: 0.35, attack: 0.001, decay: 0.06, duration: 0.07 }); 220 - } 216 + if (localWasMoving && !isMoving) { 217 + synth?.({ type: "square", tone: 800, volume: 0.35, attack: 0.001, decay: 0.06, duration: 0.07 }); 221 218 } 222 219 localWasMoving = isMoving; 223 220 } ··· 340 337 } 341 338 } 342 339 343 - // DEBUG: show bullet count 344 - ink(255, 0, 0).write(`B:${bullets.length}`, { x: 4, y: 4 }); 345 - 346 340 if (phase === "fight" || phase === "roundover") { 347 - // Bullets (extrapolated client-side for smoothness) 341 + // Bullets 348 342 for (const b of bullets) { 349 343 const alpha = Math.max(40, 255 - (b.age || 0) * 1.2); 350 344 if (b.owner === myHandle) ink(50, 120, 200, alpha); 351 345 else ink(200, 70, 60, alpha); 352 346 circle(ox + Math.round(b.x), oy + Math.round(b.y), BULLET_R, true); 353 - // DEBUG: draw bigger marker so bullet is unmissable 354 - ink(255, 0, 0, 120).box(ox + Math.round(b.x) - 4, oy + Math.round(b.y) - 4, 8, 8); 355 347 } 356 348 357 349 // Target indicator