1
0
Fork 0

feat(music): add gameplay background music

This commit is contained in:
Henrik Hautakoski 2025-11-09 06:58:26 +01:00
parent eb7486f57c
commit 562d47a723
2 changed files with 4 additions and 0 deletions

View file

@ -7,6 +7,7 @@ import (
const ( const (
SFX_SHAPE_LOCKED audio.SoundID = 0 SFX_SHAPE_LOCKED audio.SoundID = 0
SFX_ROW_CLEARED audio.SoundID = 1 SFX_ROW_CLEARED audio.SoundID = 1
SFX_MUSIC audio.SoundID = 3
SFX_MENU_SELECT audio.SoundID = 0 SFX_MENU_SELECT audio.SoundID = 0
SFX_MENU_ENTER audio.SoundID = 1 SFX_MENU_ENTER audio.SoundID = 1
SFX_MENU_SOUND_VOLUME_SELECT audio.SoundID = 1 SFX_MENU_SOUND_VOLUME_SELECT audio.SoundID = 1

View file

@ -54,9 +54,12 @@ func (gp *GamePlay) Enter() {
gp.nextShape = gp.shapeQueue.Next() gp.nextShape = gp.shapeQueue.Next()
gp.SpawnShape() gp.SpawnShape()
gp.lineClearAnimation.Reset() gp.lineClearAnimation.Reset()
audio.PlayLooped(assets.SFX_MUSIC)
} }
func (GamePlay) Exit() { func (GamePlay) Exit() {
audio.Stop(assets.SFX_MUSIC)
} }
func (gp *GamePlay) SpawnShape() { func (gp *GamePlay) SpawnShape() {