Skip to content

Conversation

@jackandcarter
Copy link
Owner

Motivation

  • Prevent spread (multi-bullet) power-ups from playing the bullet SFX once per spawned bullet which causes amplified/unnatural audio.
  • Preserve the existing rapid-fire / machine-gun audio behavior, which is a separate mechanic and should remain unchanged.
  • Ensure bullet ownership and debug logging remain intact when changing how and when sounds are played.

Description

  • Add a playSound parameter to SpawnBullet and return a bool indicating whether a bullet was spawned via SpawnBullet(..., playSound).
  • For single-bullet shots call SpawnBullet(..., playSound: true) so per-shot audio is preserved for normal fire.
  • For spread (count > 1) suppress per-bullet SFX (playSound: false) and play a single AudioManager.Instance.PlaySoundEffect(AudioManager.Instance.playerBulletSound) if any bullet was spawned.
  • Retain bulletComponent.ownerPlayerIndex assignment and existing debug logging when a bullet is spawned.

Testing

  • No automated tests were run.
  • Local compile checks were performed as part of development (no runtime tests executed).
  • Manual review ensured sound is emitted once for spread volleys and still per-shot for single bullets.

Codex Task

@jackandcarter jackandcarter merged commit 4a0eb77 into v1.0.4 Dec 27, 2025
1 check failed
@jackandcarter jackandcarter deleted the codex/fix-spreader-power-up-shot-sound branch December 27, 2025 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants