Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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_obrazow = []
- for i in range(1,4):
- sciezka = f"images/{typ}{i}.png"
- wczytany_obraz = Obraz(sciezka)
- self.lista_obrazow.append(wczytany_obraz)
- def wybierzNastepny(self):
- self.wybrany +=1
- if self.wybrany > 2:
- self.wybrany = 0
- def wybranyObraz(self):
- return self.lista_obrazow[self.wybrany].obraz
- class Head(Element):
- def __init__(self):
- super().__init__("head")
- class Body(Element):
- def __init__(self):
- super().__init__("body")
- class Eye(Element):
- def __init__(self):
- super().__init__("eye")
- class Weapon(Element):
- def __init__(self):
- super().__init__("weapon")
Advertisement
Add Comment
Please, Sign In to add comment