Show
Ignore:
Timestamp:
01/05/07 02:43:51 (5 years ago)
Author:
mg
Message:

More sound effects.

Files:
1 modified

Legend:

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

    r237 r239  
    556556        self.dead = False 
    557557        self.spawn_time = 0 # the value of world.time when last respawned 
     558        self.hit_effect = None 
     559        self.explode_effect = None 
    558560 
    559561    def _set_direction(self, direction): 
     
    640642            killed_by = other.launched_by 
    641643            self.velocity += other.velocity * self.missile_recoil 
     644            if self.hit_effect: 
     645                self.hit_effect(self, other) 
    642646        else: 
    643647            self.health -= self.collision_damage 
     
    659663        self.add_debris(time=50, maxdistance=self.size * 0.5, 
    660664                        howmany=self.world.rng.randrange(9, 21)) 
     665        if self.explode_effect: 
     666            self.explode_effect(self, killed_by) 
    661667 
    662668    def respawn(self):