Show
Ignore:
Timestamp:
01/05/07 03:25:05 (5 years ago)
Author:
mg
Message:

Change the way missile launch sound effects work, to be more like the others.
Fixes a bug where you would hear launch sounds when you pressed the fire key
while your ship was dead.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/pyspacewar/ui.py

    r244 r245  
    20112011        self.ships = self.game.ships 
    20122012        for ship in self.ships: 
     2013            ship.launch_effect = self.launch_effect_Ship 
    20132014            ship.bounce_effect = self.bounce_effect_Ship 
    20142015            ship.hit_effect = self.hit_effect_Ship 
     
    22702271        if not self.ai_controlled[player_id]: 
    22712272            self.ships[player_id].launch() 
     2273 
     2274    def launch_effect_Ship(self, ship, obstacle): 
     2275        """Play a sound effect when the player's ship bounces off something.""" 
     2276        player_id = self.ships.index(ship) 
     2277        if not self.ai_controlled[player_id]: 
    22722278            self.fire_sound.play() 
    22732279