from majkel_dzaksyn import pygame

class Obraz(pygame.sprite.Sprite):
    def __init__(self, sciezka):
        super().__init__()
        self.obraz = pygame.image.load(sciezka)

class Element():
    def __init__(self,typ):
        self.wybrany = 0
        self.lista_wyborow = [1,2,3]

        for i in range(1,4):
            sciezka = f"images/{typ}{i}.png"
            wyczytany_obraz = Obraz(sciezka)
            self.lista_obrazow.append(wyczytany_obraz)
    
    def wybierz_nastepny(self):
        self.wybrany += 1
        if self.wybrany >=2:
            self.wybrany = 0

    def wybraby_obraz(self):
        return self.lista_wyborow[self.wybrany].obraz