feat(music): add gameplay background music
This commit is contained in:
parent
eb7486f57c
commit
562d47a723
2 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue