dodana obsluga przyciskow 'q' i 's'

This commit is contained in:
Adam Osiowy 2020-04-25 16:33:44 +02:00
parent cc6fdc2e8b
commit 1dc9e45f19

View File

@ -38,6 +38,8 @@ def game():
done = False
clock = pygame.time.Clock()
start = False
# -------- Glowna petla programu -----------
while not done:
@ -55,7 +57,14 @@ def game():
print("Click ", pozycja_myszki,
"Grid coordinates: ", wiersz, kolumna)
obiekty["plansza"][kolumna,wiersz].setKolor(BLACK)
rysowaniePlanszy(obiekty)
pressed = pygame.key.get_pressed()
if pressed[pygame.K_q]:
start = False
if pressed[pygame.K_s]:
start = True
if start:
obiekty["smieciarka"].rand_move()
clock.tick(7)
pygame.quit()