From: Neil Date: Wed, 2 Mar 2016 21:59:47 +0000 (+0200) Subject: Rename to be more distinct from actor layers X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=192d7bf00ebe46c3984c70634ca90370ee0cbc09;p=koperkapel.git Rename to be more distinct from actor layers --- diff --git a/koperkapel/scenes/level.py b/koperkapel/scenes/level.py index 620e290..37f5540 100644 --- a/koperkapel/scenes/level.py +++ b/koperkapel/scenes/level.py @@ -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) diff --git a/koperkapel/scenes/viewlevel.py b/koperkapel/scenes/viewlevel.py index 88e9217..0925067 100644 --- a/koperkapel/scenes/viewlevel.py +++ b/koperkapel/scenes/viewlevel.py @@ -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)]