Changeset 242
- Timestamp:
- 01/05/07 03:18:50 (5 years ago)
- Location:
- trunk/src/pyspacewar
- Files:
-
- 2 added
- 2 modified
-
sounds/Pink_Noise1.au (added)
-
sounds/Pink_Noise1.wav (added)
-
sounds/README.txt (modified) (1 diff)
-
ui.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/pyspacewar/sounds/README.txt
r239 r242 2 2 http://www.partnersinrhyme.com/pir/PIRsfx.shtml 3 3 4 Grenade2.wav was produced from Grenade2.pcm with 5 mplayer Grenade2.au -ao pcm:file=Grenade2.wav 4 Grenade2.wav and Pink_Noise1.wav were produced from the corresponding .au files 5 with 6 7 mplayer Grenade2.au -ao pcm:file=Grenade2.wav 8 mplayer Pink_Noise1.au -ao pcm:file=Pink_Noise1.wav -
trunk/src/pyspacewar/ui.py
r241 r242 1971 1971 def _load_sounds(self): 1972 1972 """Load bitmaps of planets.""" 1973 self.thruster_sound_playing = False 1974 self.thruster_sound = pygame.mixer.Sound(find('sounds', 1975 'Pink_Noise1.wav')) 1976 self.thruster_sound.set_volume(0.5) 1973 1977 self.fire_sound = pygame.mixer.Sound(find('sounds', 1974 1978 'Gun_Silencer.wav')) … … 2118 2122 pressed = pygame.key.get_pressed() 2119 2123 self.ui_mode.handle_held_keys(pressed) 2124 self.update_continuous_sounds() 2120 2125 2121 2126 def quit(self): … … 2290 2295 if not self.ai_controlled[player_id]: 2291 2296 self.respawn_sound.play() 2297 2298 def update_continuous_sounds(self): 2299 """Loop certain sound effects while certain conditions hold true.""" 2300 makes_noise = False 2301 for player_id, ship in enumerate(self.ships): 2302 if not self.ai_controlled[player_id]: 2303 makes_noise = (ship.forward_thrust or ship.rear_thrust or 2304 ship.left_thrust or ship.right_thrust or 2305 ship.engage_brakes) or makes_noise 2306 if self.thruster_sound_playing and not makes_noise: 2307 self.thruster_sound.stop() 2308 elif not self.thruster_sound_playing and makes_noise: 2309 self.thruster_sound.play(-1) 2310 self.thruster_sound_playing = makes_noise 2292 2311 2293 2312 def draw(self):
