diff options
Diffstat (limited to 'bridge.py')
-rw-r--r-- | bridge.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -6,6 +6,7 @@ class Bridge: self.screen = game.screen self.world = game.world self.joints = [] + self.cost = 0 def create_world(self): rect = pygame.Rect((0,800), (350, -250)) @@ -19,9 +20,17 @@ class Bridge: self.world.add.rect(rect.center, rect.width / 2, rect.height / 2, dynamic=False) + def add_cost(self, value): + self.cost = self.cost + value + print "cost now", value + def joint_added(self, joint): print "joint added!" self.joints.append(joint) + self.add_cost(100) + + def box_added(self): + self.add_cost(10) def for_each_frame(self): for joint in self.joints: |