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

Another sound effect: bouncing off something.

Add sound effects to the set of distributed files in setup.py

Files:
1 modified

Legend:

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

    r231 r237  
    346346        self.appearance = appearance 
    347347        self.world = None 
     348        self.bounce_effect = None 
    348349 
    349350    def distanceTo(self, other): 
     
    463464        collision_distance = other.radius + self.radius 
    464465        self.position = other.position + normal.scaled(collision_distance) 
     466        if self.bounce_effect: 
     467            self.bounce_effect(self, other) 
    465468 
    466469    def add_debris(self, howmany=None, maxdistance=1.0, time=5.0):