mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
examples/flappy: Bug fix: an audio context was created multiple times
Closes #1739
This commit is contained in:
parent
ddf2310285
commit
852c787743
@ -175,7 +175,9 @@ func (g *Game) init() {
|
||||
g.pipeTileYs[i] = rand.Intn(6) + 2
|
||||
}
|
||||
|
||||
g.audioContext = audio.NewContext(48000)
|
||||
if g.audioContext == nil {
|
||||
g.audioContext = audio.NewContext(48000)
|
||||
}
|
||||
|
||||
jumpD, err := vorbis.Decode(g.audioContext, bytes.NewReader(raudio.Jump_ogg))
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user