Tweak level loading code
authorNeil <neil@dip.sun.ac.za>
Mon, 15 Apr 2013 12:53:05 +0000 (14:53 +0200)
committerNeil <neil@dip.sun.ac.za>
Mon, 15 Apr 2013 12:53:05 +0000 (14:53 +0200)
erdslangetjie/level.py

index 4dffd6deb759fa075e29eda28b3867226fef2634..645a62f7678aca49f89f85a024dbaf4cc9ecd327 100644 (file)
@@ -14,7 +14,10 @@ class Level(object):
     def load(self, levelfile):
         """Load the level"""
         self.data = []
-        for line in levelfile.readlines():
+        # Because of how kivy's coordinate system works,
+        # we reverse the lines so things match up between
+        # the file and the display (top of file == top of display)
+        for line in reversed(levelfile.readlines()):
             self.data.append(list(line.strip('\n')))
 
     def load_tiles(self):