Rename to be more distinct from actor layers
authorNeil <neil@dip.sun.ac.za>
Wed, 2 Mar 2016 21:59:47 +0000 (23:59 +0200)
committerNeil <neil@dip.sun.ac.za>
Thu, 3 Mar 2016 08:34:37 +0000 (10:34 +0200)
koperkapel/scenes/level.py
koperkapel/scenes/viewlevel.py

index 620e290deadfa894b749fda109af250952a85de1..37f554012e7500db17585a88a0c27f6d13beac70 100644 (file)
@@ -14,7 +14,7 @@ class LevelScene(Scene):
     def enter(self, world):
         self._level_data = levels.load(world.level.name)
         self._tiles = self._level_data['tiles']
-        self._layer = 'floor'
+        self._level_layer = 'floor'
         self._surfaces = {}
         self._overlay = {}
         for layer in ['floor', 'tunnels']:
@@ -43,14 +43,14 @@ class LevelScene(Scene):
         # surface. We need the position of the surface relative to
         # the screen for the blit, so this conversion
         screen_pos = -viewport[0], -viewport[1]
-        if self._layer == 'floor':
-            screen.blit(self._surfaces[self._layer], screen_pos)
+        if self._level_layer == 'floor':
+            screen.blit(self._surfaces[self._level_layer], screen_pos)
         else:
             # blit tunnels, with translucent overlay
             # We need to call pygame.Surface.blit ourselves,
             # since pgzero's screen blit hides the blend flags
             # from us
-            tunnels = self._surfaces[self._layer].copy()
+            tunnels = self._surfaces[self._level_layer].copy()
             tunnels.blit(self._overlay, (0, 0),
                          special_flags=pgl.BLEND_MULT)
             screen.blit(tunnels, screen_pos)
index 88e9217444a0fc64849a58763172131a514f73de..092506721c7aee654c63dd869d502d202898397c 100644 (file)
@@ -20,10 +20,10 @@ class ViewLevelScene(LevelScene):
         elif key == keys.RIGHT:
             offset = (TILE_SIZE, 0)
         elif key == keys.S:
-            if self._layer == 'floor':
-                self._layer = 'tunnels'
+            if self._level_layer == 'floor':
+                self._level_layer = 'tunnels'
             else:
-                self._layer = 'floor'
+                self._level_layer = 'floor'
             return
         if offset:
             return [MoveViewportEvent(offset)]