diff --git a/blocks.py b/blocks.py index a1b9ebe..44aa692 100644 --- a/blocks.py +++ b/blocks.py @@ -2,17 +2,17 @@ # -*- coding: utf-8 -*- from pygame import * +import os PLATFORM_WIDTH = 32 PLATFORM_HEIGHT = 32 PLATFORM_COLOR = "#FF6262" - +ICON_DIR = os.path.dirname(__file__) # Полный путь к каталогу с файлами class Platform(sprite.Sprite): def __init__(self, x, y): sprite.Sprite.__init__(self) self.image = Surface((PLATFORM_WIDTH, PLATFORM_HEIGHT)) self.image.fill(Color(PLATFORM_COLOR)) - self.image = image.load("blocks/platform.png") + self.image = image.load("%s/blocks/platform.png" % ICON_DIR) self.rect = Rect(x, y, PLATFORM_WIDTH, PLATFORM_HEIGHT) -