Changeset 239 for trunk/src/pyspacewar/ui.py
- Timestamp:
- 01/05/07 02:43:51 (5 years ago)
- Files:
-
- 1 modified
-
trunk/src/pyspacewar/ui.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/pyspacewar/ui.py
r238 r239 1974 1974 self.bounce_sound = pygame.mixer.Sound(find('sounds', 1975 1975 'electricshock.wav')) 1976 self.hit_sound = pygame.mixer.Sound(find('sounds', 'Grenade2.wav')) 1977 self.explode_sound = pygame.mixer.Sound(find('sounds', 'bomb.wav')) 1976 1978 1977 1979 def _init_fonts(self): … … 2003 2005 for ship in self.ships: 2004 2006 ship.bounce_effect = self.bounce_effect_Ship 2007 ship.hit_effect = self.hit_effect_Ship 2008 ship.explode_effect = self.explode_effect_Ship 2005 2009 self.ai = map(AIController, self.ships) 2006 2010 self.ai_controlled = [False] * len(self.ships) … … 2260 2264 """Play a sound effect when the player's ship bounces off something.""" 2261 2265 player_id = self.ships.index(ship) 2266 if not self.ai_controlled[player_id] and not ship.dead: 2267 self.bounce_sound.play() 2268 2269 def hit_effect_Ship(self, ship, missile): 2270 """Play a sound effect when the player's ship is hit.""" 2271 player_id = self.ships.index(ship) 2262 2272 if not self.ai_controlled[player_id]: 2263 self.bounce_sound.play() 2273 self.hit_sound.play() 2274 2275 def explode_effect_Ship(self, ship, killer): 2276 """Play a sound effect when the player's ship explodes.""" 2277 player_id = self.ships.index(ship) 2278 if not self.ai_controlled[player_id]: 2279 self.explode_sound.play() 2264 2280 2265 2281 def draw(self):
