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':
class GameLevelScene(BaseLevelScene):
def enter(self, world):
+ if self._level is not None:
+ return
super().enter(world)
self._roaches = self.actors.add_layer("roaches", level=10)
self._vehicle = Vehicle.current(world)