diff options
| author | Viljami Ilola <+@hix.fi> | 2024-04-27 01:29:45 +0300 | 
|---|---|---|
| committer | Viljami Ilola <+@hix.fi> | 2024-04-27 01:29:45 +0300 | 
| commit | 7a33e5020f9b1e7cf89bc532e2ddcf681f5bcf9c (patch) | |
| tree | 544e868288f05213452dec9b7b789bd1eb208191 /src/sliceitoff/game/settings.py | |
| parent | a4794437d561a01c8bea12d59502e4cc72acfbea (diff) | |
volume control
Diffstat (limited to 'src/sliceitoff/game/settings.py')
| -rw-r--r-- | src/sliceitoff/game/settings.py | 17 | 
1 files changed, 12 insertions, 5 deletions
| diff --git a/src/sliceitoff/game/settings.py b/src/sliceitoff/game/settings.py index 6a709a4..53d0362 100644 --- a/src/sliceitoff/game/settings.py +++ b/src/sliceitoff/game/settings.py @@ -1,4 +1,4 @@ -""" game.mainmenu - Let's user choose """ +""" game.settings - Settings dialog """  from enum import IntEnum  import pygame @@ -11,16 +11,16 @@ from .explodeout import ExplodeOutGroup  MOUSE_TRESHOLD = 100  class MenuItems(IntEnum): -    """ Items in the menu. Should match mainmenu_screen """ +    """ Items in the menu. Should match settings_screen """      SFX = 0      MUSIC = 1      BACK = 2 -class Settings(ExplodeOutGroup): +class SettingsMenu(ExplodeOutGroup):      """ sprite group with imputs to make selection """      def __init__(self):          super().__init__() -        self.add(settings_screen(0)) +        self.add(settings_screen(0,0,0))          self.selection = 0          self.mousey = 0 @@ -29,6 +29,10 @@ class Settings(ExplodeOutGroup):          match self.selection:              case MenuItems.BACK:                  self.do_fadeout() +            case MenuItems.SFX: +                sfx.sfx_up() +            case MenuItems.MUSIC: +                sfx.music_up()      def update(self, dt = 0, **kwargs):          """ Does it all. Reads keyboard and updates screen """ @@ -49,7 +53,10 @@ class Settings(ExplodeOutGroup):              elif event.type == pygame.MOUSEMOTION:                  self.process_mouse_motion()          self.empty() -        self.add(settings_screen(self.selection)) +        self.add(settings_screen( +                self.selection, +                sfx.sfx_volume, +                sfx.music_volume))      def process_mouse_motion(self):          """ Mouse movement up or down moves menu selection """ |