changeset 557:943d93b47c77

Ignore the pymunk AssertionError on level change
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 07 Sep 2013 22:10:12 +0200
parents 6710bc95a80c
children 4abf8cf717e9
files nagslang/screens/base.py
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/nagslang/screens/base.py	Sat Sep 07 22:03:48 2013 +0200
+++ b/nagslang/screens/base.py	Sat Sep 07 22:10:12 2013 +0200
@@ -1,5 +1,7 @@
 """A screen or area in which action happens."""
 
+import sys
+
 from pygame import event
 import pymunk
 
@@ -29,4 +31,11 @@
 
     def tick(self, seconds):
         """Step the given amount of time."""
-        self.space.step(seconds)
+        try:
+            self.space.step(seconds)
+        except AssertionError:
+            # TODO: Find the source of these
+            print >> sys.stderr, (
+                'Caught a pymunk assertion error. '
+                "We don't know what causes these on level change. "
+                "Hopefully we can ignore them...")