From b02c431345ac4743d6a13e8e67e7967339e06001 Mon Sep 17 00:00:00 2001 From: Bowske Date: Fri, 3 Apr 2020 18:17:25 +0200 Subject: [PATCH] obsluga bledow --- game.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/game.py b/game.py index a724525..d4b5c7c 100644 --- a/game.py +++ b/game.py @@ -69,13 +69,16 @@ plansza[4, 4].setJestKontenerem(True) doms_array = ['resources/plansza/domy/dom1.png', 'resources/plansza/domy/dom2.png', 'resources/plansza/domy/dom3.png', 'resources/plansza/domy/dom4.png', 'resources/plansza/domy/dom5.png'] -for i in range(0, 5): - temp = [random.randint(5, 14), random.randint(5, 14)] - print(temp) - dom = modele.Dom(temp[0], temp[1]) + +temp = random.sample(range(5, 14), 8) +k = 0 +for i in range(0, 4): + dom = modele.Dom(temp[k], temp[k+1]) dom.setImage(pygame.image.load(random.choice(doms_array))) plansza[temp[0], temp[1]].setJestDomem(True) all_sprites_list.add(dom) + k = k+2 + print(k) # ustawienie wysypiska, rozmiar wysypiska 5x5