Wire the audio player in Run, not in NewGame
ci/woodpecker/push/woodpecker Pipeline was successful

AudioPlayer keeps the *AssetManager it is handed, so attaching it during
construction quietly pinned it to the manager NewGame happened to make. A
domain that assigns its own registry onto the Game — legal, the fields are
plain *Manager values — got a working image path and a silent audio one.

Run attaches instead, once the Game is final.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-30 10:36:13 +02:00
co-authored by Claude Opus 5
parent 08f15a7e3d
commit 39af65f3c9
3 changed files with 32 additions and 6 deletions
+4
View File
@@ -7,6 +7,10 @@ import (
// Run validates the game, then enters the ebiten main loop. The window is
// sized to 4× the internal resolution.
func Run(g *Game) error {
// The domain may have swapped a manager in since NewGame, so the parts
// that hold a registry directly are wired here, not at construction.
g.Audio.attach(g.AssetManager)
if err := g.Validate(); err != nil {
return err
}