diff options
Diffstat (limited to 'physics.py')
-rw-r--r-- | physics.py | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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: |