import pygame import glob2 import random TILE_SIZE = 50 class Package: def __init__(self, window): self.window = window self.imageDefault = pygame.image.load('resources/indeks.png').convert_alpha() self.x = 1150 self.y = 350 self.markImage = self.getMarkingImage() def getMarkingImage(self): file_path_type = ["resources/package/*.jpg"] images = glob2.glob(random.choice(file_path_type)) markImage = random.choice(images) print(markImage) return markImage def drawPackage(self): self.window.blit(self.imageDefault, (self.x, self.y)) pygame.display.flip()