Changeset 237 for trunk/src/pyspacewar/ui.py
- Timestamp:
- 01/05/07 02:21:51 (5 years ago)
- Files:
-
- 1 modified
-
trunk/src/pyspacewar/ui.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/pyspacewar/ui.py
r236 r237 1972 1972 self.fire_sound = pygame.mixer.Sound(find('sounds', 1973 1973 'Gun_Silencer.wav')) 1974 self.bounce_sound = pygame.mixer.Sound(find('sounds', 1975 'electricshock.wav')) 1974 1976 1975 1977 def _init_fonts(self): … … 1999 2001 rng=self.rng) 2000 2002 self.ships = self.game.ships 2003 for ship in self.ships: 2004 ship.bounce_effect = self.bounce_effect_Ship 2001 2005 self.ai = map(AIController, self.ships) 2002 2006 self.ai_controlled = [False] * len(self.ships) … … 2253 2257 self.fire_sound.play() 2254 2258 2259 def bounce_effect_Ship(self, ship, obstacle): 2260 """Play a sound effect when the player's ship bounces off something.""" 2261 player_id = self.ships.index(ship) 2262 if not self.ai_controlled[player_id]: 2263 self.bounce_sound.play() 2264 2255 2265 def draw(self): 2256 2266 """Draw the state of the game""" … … 2445 2455 self.update_missile_trails() 2446 2456 self.framedrop_needed = not self.game.wait_for_tick() 2447
