diff options
author | Daniel Francis <francis@sugarlabs.org> | 2012-12-21 14:18:54 (GMT) |
---|---|---|
committer | Daniel Francis <francis@sugarlabs.org> | 2012-12-21 14:18:54 (GMT) |
commit | 9674738abc8984d15b55418e52718ac28669cc7d (patch) | |
tree | fe730b585a78280ece79488c5612698b8e89160b /physics.py | |
parent | eff264857d005719f081eb9fea1e8b099670d395 (diff) |
Activity completely ported to sugargame with no regressions
Signed-off-by: Daniel Francis <francis@sugarlabs.org>
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: |