Get view-menu to play the interface sound
This commit is contained in:
@@ -7,12 +7,12 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/hajimehoshi/ebiten"
|
||||
|
||||
"code.ur.gs/lupine/ordoor/internal/assetstore"
|
||||
"code.ur.gs/lupine/ordoor/internal/data"
|
||||
"code.ur.gs/lupine/ordoor/internal/menus"
|
||||
"code.ur.gs/lupine/ordoor/internal/ui"
|
||||
"github.com/hajimehoshi/ebiten"
|
||||
"github.com/hajimehoshi/ebiten/audio"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -76,6 +76,20 @@ func main() {
|
||||
menuObjs = append(menuObjs, obj)
|
||||
}
|
||||
|
||||
// Yay sound
|
||||
if _, err := audio.NewContext(48000); err != nil {
|
||||
log.Fatalf("Failed to audio: %v", err)
|
||||
}
|
||||
music, err := assets.Sound("music_interface") // FIXME: should be a reference to Sounds.dat
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to find interface music: %v", err)
|
||||
}
|
||||
player, err := music.InfinitePlayer()
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to generate music player for interface: %v", err)
|
||||
}
|
||||
player.Play()
|
||||
|
||||
state := state{}
|
||||
env := &env{
|
||||
menu: menu,
|
||||
|
Reference in New Issue
Block a user