Changeset 248
- Timestamp:
- 01/05/07 04:06:01 (5 years ago)
- Location:
- trunk/src/pyspacewar
- Files:
-
- 1 added
- 2 modified
-
music/README.txt (modified) (1 diff)
-
music/music.ini (added)
-
ui.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/pyspacewar/music/README.txt
r247 r248 3 3 4 4 If you want you, you can take your favourite tunes and place them in this 5 directory, with the following names: 6 7 demo.ogg 8 game.ogg 9 gravitywars.ogg 10 5 directory, then put their file names in music.ini. -
trunk/src/pyspacewar/ui.py
r247 r248 1995 1995 def _load_music(self): 1996 1996 """Load music files.""" 1997 self.music_files = { 1998 'demo': find('music', 'demo.ogg'), 1999 'game': find('music', 'game.ogg'), 2000 'gravitywars': find('music', 'gravitywars.ogg'), 2001 } 1997 config = ConfigParser.RawConfigParser() 1998 config.add_section('music') 1999 config.read([find('music', 'music.ini')]) 2000 self.music_files = {} 2001 for what in ['demo', 'game', 'gravitywars']: 2002 if config.has_option('music', what): 2003 filename = config.get('music', what) 2004 if filename: 2005 self.music_files[what] = find('music', filename) 2002 2006 2003 2007 def play_music(self, which): … … 2013 2017 pygame.mixer.music.play(-1) 2014 2018 except pygame.error: 2015 # Don't print warnings while I don't have any music actually 2016 # bundled with pyspacewar 2017 # print "pyspacewar: could not load %s" % filename 2019 print "pyspacewar: could not load %s" % filename 2018 2020 pygame.mixer.music.stop() 2019 2021 self.now_playing = which
