It is now possible to define different smash properties for different
It is now possible to define different smash properties for different
objects.

file:a/smasher.py -> file:b/smasher.py
--- a/smasher.py
+++ b/smasher.py
@@ -110,8 +110,8 @@
         points=[]
         for area in self.areas:
             for i in range(self.nFragments):
-                x=random.gauss(area[0].x,area[1]/100)
-                y=random.gauss(area[0].y,area[1]/100)
+                x=random.gauss(area[0].x,area[1])
+                y=random.gauss(area[0].y,area[1])
                 points.append((x,y))
         return points
 
@@ -122,18 +122,26 @@
 
     def postsolve(self,contact,impulse):
         for i in range(impulse.count):
-            if impulse.normalImpulses[i]>10:
-                self.break_fixture(contact.fixtureA,impulse.normalImpulses[i],contact.worldManifold.points[i])
-                self.break_fixture(contact.fixtureB,impulse.normalImpulses[i],contact.worldManifold.points[i])
+            self.break_fixture(contact.fixtureA,impulse.normalImpulses[i],contact.worldManifold.points[i])
+            self.break_fixture(contact.fixtureB,impulse.normalImpulses[i],contact.worldManifold.points[i])
 
     def break_fixture(self,fixture,impulse,worldPoint):
-      if fixture.body.type==b2_dynamicBody:
-          localPoint=fixture.body.GetLocalPoint(worldPoint)
-          obj=self.object_for_body(fixture.body)
-          if obj:
-              if obj not in self.queue:
-                  self.queue[obj]=[]
-              self.queue[obj].append((localPoint,impulse))
+        if fixture.body.type!=b2_dynamicBody: return # Don't break non-dynamic bodies
+
+        obj=self.object_for_body(fixture.body)
+        if not obj: return # This is not a game object..
+
+        smashInfo=None
+        if not hasattr(obj,'smashInfo'):
+            smashInfo=SmashInfo()
+        else:
+            smashInfo=obj.smashInfo
+
+        if impulse<smashInfo.treshold_impulse: return # Smash treshold not passed
+        localPoint=fixture.body.GetLocalPoint(worldPoint)
+        if obj not in self.queue:
+            self.queue[obj]=[]
+        self.queue[obj].append((localPoint,impulse/smashInfo.brittleness))
 
     def object_for_body(self,body):
         for obj in self.game.objects:
@@ -148,3 +156,8 @@
             self.game.physmasher.smash(key)
         self.queue={}
 
+class SmashInfo(object):
+    def __init__(self):
+        self.treshold_impulse=10
+        self.brittleness=100
+