"""Render a level and allow moving the scene"""
-import os
-
from pygame.constants import BLEND_RGBA_MULT
from pgzero.constants import keys
from pgzero.loaders import images
from .level import BaseLevelScene
from .base import MoveViewportEvent
from ..constants import TILE_SIZE
+from ..util import safepath
class ViewLevelScene(BaseLevelScene):
def enter(self, world):
super().enter(world)
# Mark starting position
- self._roach = images.load(os.path.join("roach/roach_1")).copy()
+ self._roach = images.load(safepath("roach/roach_1")).copy()
self._roach.fill((255, 0, 0, 255), None, BLEND_RGBA_MULT)
x = self._level.start_pos[0] * TILE_SIZE
y = self._level.start_pos[1] * TILE_SIZE