Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/bridge.py
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2008-08-31 00:13:09 (GMT)
committer Daniel Drake <dsd@laptop.org>2008-08-31 00:13:09 (GMT)
commit901a8a638a92b2138b6ce27dd7e90b3b3b4d1833 (patch)
treeb27c9504dd356c61ee4902413c09ceb22126c2ad /bridge.py
parent233d543dab3f0a656d1e34ed306a08ffcee85c73 (diff)
add concept of cost
Diffstat (limited to 'bridge.py')
-rw-r--r--bridge.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/bridge.py b/bridge.py
index 62a0f76..e254340 100644
--- a/bridge.py
+++ b/bridge.py
@@ -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: