diff --git a/game.py b/game.py index ea0edab..28f87ad 100644 --- a/game.py +++ b/game.py @@ -5,6 +5,7 @@ import random import os import shutil + pygame.init() # kolory @@ -30,7 +31,8 @@ ILOSC_KOLUMN = 15 WINDOW_SIZE = [1300, 980] # Tworzenie planszy i kratek -plansza = np.array([[modele.Kratka(i, j) for i in range(ILOSC_KOLUMN)] for j in range(ILOSC_WIERSZY)]) +plansza = np.array([[modele.Kratka(i, j) for i in range(ILOSC_KOLUMN)] + for j in range(ILOSC_WIERSZY)]) all_sprites_list = pygame.sprite.Group() # smieciarka @@ -86,9 +88,10 @@ smieci_lista = [os.path.join(path, filename) for filename in files] # informacje o ilosci smieci w domach -font = pygame.font.SysFont("arial", 20, bold = True) +font = pygame.font.SysFont("arial", 20, bold=True) text_pozostalo = font.render("Pozostało śmieci w domach:", True, WHITE) + def liczSmieci(domy): ile_metalu = 0 ile_szkla = 0 @@ -112,15 +115,19 @@ def liczSmieci(domy): text_papier = font.render("Papier: " + str(ile_papieru), True, WHITE) text_plastik = font.render("Plastik: " + str(ile_plastiku), True, WHITE) text_szklo = font.render("Szkło: " + str(ile_szkla), True, WHITE) - text_pozostale = font.render("Pozostałe: " + str(ile_pozostalych), True, WHITE) - text_odwiedzone_domy = font.render("Odwiedzone domy: " + str(smieciarka.getOdwiedzoneDomy()),True,WHITE) + text_pozostale = font.render( + "Pozostałe: " + str(ile_pozostalych), True, WHITE) + text_odwiedzone_domy = font.render( + "Odwiedzone domy: " + str(smieciarka.getOdwiedzoneDomy()), True, WHITE) + + return text_metal, text_papier, text_plastik, text_szklo, text_pozostale, text_odwiedzone_domy - return text_metal, text_papier, text_plastik, text_szklo, text_pozostale,text_odwiedzone_domy for i in range(len(wspolrzedne_domow)): dom = modele.Dom(wspolrzedne_domow[i][0], wspolrzedne_domow[i][1]) dom.setImage(pygame.image.load(random.choice(doms_array))) - plansza[wspolrzedne_domow[i][0], wspolrzedne_domow[i][1]].setJestDomem(True) + plansza[wspolrzedne_domow[i][0], + wspolrzedne_domow[i][1]].setJestDomem(True) plansza[wspolrzedne_domow[i][0], wspolrzedne_domow[i][1]].setObiekt(dom) domy_lista.add(dom) all_sprites_list.add(dom) @@ -132,7 +139,7 @@ for d in lista_domow: d.dodajSmiec(smiec) smieci_lista.remove(smiec) -########## TEST DODAWANIA SMIECI Z POJEDYNCZEGO DOMU DO FOLDERU KONTENERA ZE SZKLEM +# TEST DODAWANIA SMIECI Z POJEDYNCZEGO DOMU DO FOLDERU KONTENERA ZE SZKLEM # for d in lista_domow: # for s in d.smieci: # kontener_szklo.dodajSmiec(s) @@ -147,6 +154,7 @@ all_sprites_list.add(kontener_plastik, kontener_metal, kontener_organiczne, kont def game(): + obraz = pygame.display.set_mode(WINDOW_SIZE) # Tytul okienka @@ -212,7 +220,8 @@ def game(): all_sprites_list.draw(obraz) smieciarka.rand_move() - text_metal, text_papier, text_plastik, text_szklo, text_pozostale, text_odwiedzone_domy = liczSmieci(lista_domow) + text_metal, text_papier, text_plastik, text_szklo, text_pozostale, text_odwiedzone_domy = liczSmieci( + lista_domow) obraz.blit(text_pozostalo, (1020, 240)) obraz.blit(text_metal, (1020, 280)) @@ -220,7 +229,7 @@ def game(): obraz.blit(text_szklo, (1020, 360)) obraz.blit(text_papier, (1020, 400)) obraz.blit(text_pozostale, (1020, 440)) - obraz.blit(text_odwiedzone_domy, (1020,480)) + obraz.blit(text_odwiedzone_domy, (1020, 480)) pygame.display.flip() pygame.quit() diff --git a/resources/screenShots/gifProjektu.gif b/resources/screenShots/gifProjektu.gif new file mode 100644 index 0000000..2e2197c Binary files /dev/null and b/resources/screenShots/gifProjektu.gif differ diff --git a/resources/screenShots/strukturaKatalogu.png b/resources/screenShots/strukturaKatalogu.png new file mode 100644 index 0000000..3f6c993 Binary files /dev/null and b/resources/screenShots/strukturaKatalogu.png differ