def update(self, world, engine, dt):
"""Fix the door and keypad positions"""
for door in self._doors:
- door.pos = engine.calc_offset(
+ door.pos = self.calc_offset(
door.game_pos[0] * TILE_SIZE, door.game_pos[1] * TILE_SIZE)
for keypad in self._keypads:
- keypad.pos = engine.calc_offset(
+ keypad.pos = self.calc_offset(
keypad.game_pos[0] * TILE_SIZE, keypad.game_pos[1] * TILE_SIZE)
- def draw(self, screen, viewport):
+ def draw(self, screen):
screen.clear()
# Viewport is the position of the screen relative to the
# surface. We need the position of the surface relative to
# the screen for the blit, so this conversion
+ viewport = self.viewport
screen.surface.blit(self._surfaces[self._level_layer], (0, 0),
area=(viewport[0], viewport[1], WIDTH, HEIGHT))
if self._level_layer != 'floor':