Should fix index error.

This commit is contained in:
Sakse Dalum committed 2012-08-12 20:09:17 +02:00
1 parent 5fe049f585
commit f34d8106ef
2 files changed
+6 -3

No files matched your search

+5 -2
View File
@@ -78,11 +78,14 @@ class Level(object):
def _sorted_objs(self, objs=None):
return sorted(self.objects if objs is None else objs,
key=lambda obj: (obj.y + obj.z))
def draw(self, window):
self._blit_background(window)
for obj in self._sorted_objs():
obj.draw(window)
try:
obj.draw(window)
except IndexError:
print("Skipping frames ...")
self.darkness.draw(window)
+1 -1
View File
@@ -507,7 +507,7 @@ class Level1(level.Level):
for i in range(3):
self.objects.append(
CompletionBlock(self, 64 * (door_x - 6 + i), 48 * 4,
CompletionBlock(self, 64 * (door_x - 5 + i), 48 * 4,
self.solution[i], i + 1))
# DRAW THE BACKGROUND