Commit 2676803
committed
Implement task 032: sound system
Add pkg/audio with SoundSystem backed by WAV files extracted from the
disassembly project (44100 Hz, 16-bit PCM mono, embedded via embed.FS).
Continuous sounds (engine ×3, low-fuel warning) loop via
audio.NewInfiniteLoop; the engine player swaps immediately on speed
change. The refuel beep is a one-shot replayed each frame while over a
depot (spec §14.5). All other sounds are one-shot edge-triggered from
ControlFlags (fire, explosion, bonus life, fuel-full) or state
transitions (shell whistle on IsFlying, heli missile on Active).
All sounds are suppressed during scroll-in and while paused (spec §14.7);
StopAll is called on those frames and also on restart / return-to-menu.
Supporting changes:
- ControlFlags.FuelFull: set once when fuel transitions to cap during
refueling (FuelResult.FuelFull from UpdateFuel).
- Controls.FireSound: set in applyInput when a missile actually launches.
- go.mod/go.sum: add ebitengine/oto/v3 (pulled in by ebiten/v2/audio).1 parent 43c6ed6 commit 2676803
22 files changed
Lines changed: 367 additions & 4 deletions
File tree
- pkg
- audio
- assets/audio
- game
- logic
- state
- spec
- tasks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
| |||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 commit comments