Skip to content

Commit 2676803

Browse files
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

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ require (
6060
github.com/dlclark/regexp2 v1.11.5 // indirect
6161
github.com/ebitengine/gomobile v0.0.0-20250923094054-ea854a63cce1 // indirect
6262
github.com/ebitengine/hideconsole v1.0.0 // indirect
63+
github.com/ebitengine/oto/v3 v3.4.0 // indirect
6364
github.com/ebitengine/purego v0.9.1 // indirect
6465
github.com/ettle/strcase v0.2.0 // indirect
6566
github.com/fatih/color v1.18.0 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ github.com/ebitengine/gomobile v0.0.0-20250923094054-ea854a63cce1 h1:+kz5iTT3L7u
160160
github.com/ebitengine/gomobile v0.0.0-20250923094054-ea854a63cce1/go.mod h1:lKJoeixeJwnFmYsBny4vvCJGVFc3aYDalhuDsfZzWHI=
161161
github.com/ebitengine/hideconsole v1.0.0 h1:5J4U0kXF+pv/DhiXt5/lTz0eO5ogJ1iXb8Yj1yReDqE=
162162
github.com/ebitengine/hideconsole v1.0.0/go.mod h1:hTTBTvVYWKBuxPr7peweneWdkUwEuHuB3C1R/ielR1A=
163+
github.com/ebitengine/oto/v3 v3.4.0 h1:br0PgASsEWaoWn38b2Goe7m1GKFYfNgnsjSd5Gg+/bQ=
164+
github.com/ebitengine/oto/v3 v3.4.0/go.mod h1:IOleLVD0m+CMak3mRVwsYY8vTctQgOM0iiL6S7Ar7eI=
163165
github.com/ebitengine/purego v0.9.1 h1:a/k2f2HQU3Pi399RPW1MOaZyhKJL9w/xFpKAg4q1s0A=
164166
github.com/ebitengine/purego v0.9.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
165167
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
107 KB
Binary file not shown.
1.76 KB
Binary file not shown.
1.76 KB
Binary file not shown.
1.76 KB
Binary file not shown.
38.5 KB
Binary file not shown.

pkg/audio/assets/audio/fire.wav

19.1 KB
Binary file not shown.
1.76 KB
Binary file not shown.
3.08 KB
Binary file not shown.

0 commit comments

Comments
 (0)