From 74ea5bd11f3106eadb0259487afe577676bd97cd Mon Sep 17 00:00:00 2001 From: josch Date: Tue, 2 Dec 2008 07:50:06 +0100 Subject: [PATCH] turn animations on/off --- lib/mapview.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/mapview.py b/lib/mapview.py index 4437102..b5d225e 100644 --- a/lib/mapview.py +++ b/lib/mapview.py @@ -35,6 +35,7 @@ class MapView(object): color=(128, 128, 128, 128), x=self.window.width - 10, y=0, anchor_x='right', anchor_y='bottom') + self.animate = True pyglet.clock.schedule_interval(self.animate_water, 1/6.0) pyglet.clock.schedule_interval(self.update, 1/60.0) @@ -256,6 +257,13 @@ class MapView(object): elif symbol == pyglet.window.key.MINUS and self.tile_size > 16: self.tile_size-=8 self._init_view() + elif symbol == pyglet.window.key.A: + if self.animate: + pyglet.clock.unschedule(self.animate_water) + self.animate = False + else: + pyglet.clock.schedule_interval(self.animate_water, 1/6.0) + self.animate = True def update(self, dt): try: