Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/physics.py
diff options
context:
space:
mode:
Diffstat (limited to 'physics.py')
-rw-r--r--physics.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/physics.py b/physics.py
index 253ff1b..bb7f066 100644
--- a/physics.py
+++ b/physics.py
@@ -66,6 +66,9 @@ class PhysicsGame:
self.loop = True
self.pygame_started = False
+ self.full_pos_list = []
+ self.tracked_bodies = []
+
def switch_off_fake_pygame_cursor_cb(self, panel, event):
self.show_fake_cursor = False
@@ -127,6 +130,12 @@ class PhysicsGame:
self.show_fake_cursor = True
if self.in_focus:
+ # Tracking object positions which have pens on them
+ if self.tracked_bodies is not []:
+ temp_zipped = zip(self.full_pos_list, self.tracked_bodies)
+ for single_body_list, body in temp_zipped:
+ self.single_body_list.append(body.position)
+
# Drive motors
if self.world.run_physics:
for body in self.world.world.GetBodyList():