feat(game): add background music

This commit is contained in:
Kristofers Solo 2024-01-04 06:41:11 +02:00
parent a294ba4e90
commit 91587b772f
3 changed files with 12 additions and 0 deletions

BIN
assets/music/background.wav Normal file

Binary file not shown.

View File

@ -24,6 +24,10 @@ class Main:
self.score = Score()
self.preview = Preview()
self.music = pygame.mixer.Sound(CONFIG.music.background)
self.music.set_volume(CONFIG.music.volume)
self.music.play()
def draw(self) -> None:
pygame.display.update()

View File

@ -51,6 +51,13 @@ class Window:
)
@define
class Music:
background: Path = BASE_PATH / "assets" / "music" / "background.wav"
langing: Path = BASE_PATH / "assets" / "music" / "landing.wav"
volume: float = 0.01
@define
class Config:
log_level: str = "warning"
@ -59,6 +66,7 @@ class Config:
sidebar: SideBar = SideBar()
window: Window = Window()
font: Font = Font()
music: Music = Music()
colors = TokyoNightNight()
fps: int = 60