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.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/physics.py b/physics.py
index 18aa7eb..5f80527 100644
--- a/physics.py
+++ b/physics.py
@@ -55,6 +55,7 @@ class PhysicsGame:
self.currentTool = self.toolList[tools.allTools[0].name]
# Set up the world (instance of Elements)
self.box2d = box2d
+ self.opening_queue = None
def switch_off_fake_pygame_cursor_cb(self, panel, event):
self.show_fake_cursor = False
@@ -62,6 +63,15 @@ class PhysicsGame:
def switch_on_fake_pygame_cursor_cb(self, panel, event):
self.show_fake_cursor = True
+ def write_file(self, path):
+ #Saving to journal
+ self.world.add.remove_mouseJoint()
+ self.world.json_save(path)
+
+ def read_file(self, path):
+ #Loading from journal
+ self.opening_queue = path
+
def run(self):
self.screen = pygame.display.get_surface()
pygame.display.init()
@@ -88,6 +98,9 @@ class PhysicsGame:
while gtk.events_pending():
gtk.main_iteration()
+ if self.opening_queue:
+ self.world.json_load(self.opening_queue)
+
for event in pygame.event.get():
self.currentTool.handleEvents(event)
if event.type == MOUSEBUTTONUP: