feat(assets): add sound library
This commit is contained in:
parent
5860aa69d6
commit
1c31fd43ac
2 changed files with 21 additions and 3 deletions
|
|
@ -59,10 +59,10 @@ var Font = font.TileFont{
|
|||
// Sounds
|
||||
|
||||
//go:embed blip.mp3
|
||||
var SoundBlip []byte
|
||||
var SFXBlipData []byte
|
||||
|
||||
//go:embed blip2.mp3
|
||||
var SoundBlip2 []byte
|
||||
var SFXBlip2Data []byte
|
||||
|
||||
//go:embed background.mp3
|
||||
var SoundBackground []byte
|
||||
var SNDBackgroundData []byte
|
||||
|
|
|
|||
18
assets/sound.go
Normal file
18
assets/sound.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package assets
|
||||
|
||||
import (
|
||||
"tetris/engine/audio"
|
||||
)
|
||||
|
||||
const (
|
||||
SFX_SHAPE_LOCKED audio.SoundID = 0
|
||||
SFX_ROW_CLEARED audio.SoundID = 1
|
||||
)
|
||||
|
||||
func LoadSound() *audio.Library {
|
||||
return &audio.Library{
|
||||
audio.LoadFromMemory(".mp3", SFXBlipData),
|
||||
audio.LoadFromMemory(".mp3", SFXBlip2Data),
|
||||
audio.LoadFromMemory(".mp3", SNDBackgroundData),
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue