Changeset 608:9b9d529ba5d9


Ignore:
Timestamp:
Sep 7, 2013, 10:25:29 PM (7 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
rebase_source:
fddd27ea0e8c46ade9eabd959097762d87687823
Message:

Allow music volume to be specified.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • data/levels/finale

    r599 r608  
    134134  - [1000, 900]
    135135music: moonlight-sonata.ogg
     136music_volume: 1.0
    136137polygons:
    137138  1:
  • nagslang/level.py

    r582 r608  
    1313from nagslang.resources import resources
    1414from nagslang.yamlish import load, dump
     15from nagslang.constants import DEFAULT_MUSIC_VOLUME
    1516
    1617POLY_COLORS = {
     
    4344        self.basetile = 'tiles/floor.png'
    4445        self.music = None
     46        self.music_volume = None
    4547        self._tile_image = None
    4648        self._surface = None
     
    6668            'lines': self.lines,
    6769            'music': self.music,
     70            'music_volume': self.music_volume,
    6871            'game_objects': self._game_objects,
    6972            'enemies': self._enemies,
     
    9598        self.basetile = data['base_tile']
    9699        self.music = data['music']
     100        self.music_volume = data.get('music_volume', DEFAULT_MUSIC_VOLUME)
    97101        for i, points in data['polygons'].iteritems():
    98102            self.polygons[i] = []
  • nagslang/screens/area.py

    r586 r608  
    9595        self.add_game_objects()
    9696        self.save_progress()
    97         sound.play_music(self._level.music)
     97        sound.play_music(self._level.music, self._level.music_volume)
    9898        self._background = None
    9999        self._surface = None
Note: See TracChangeset for help on using the changeset viewer.