dodana obsluga przyciskow 'q' i 's'
This commit is contained in:
parent
cc6fdc2e8b
commit
1dc9e45f19
9
game.py
9
game.py
@ -38,6 +38,8 @@ def game():
|
|||||||
done = False
|
done = False
|
||||||
clock = pygame.time.Clock()
|
clock = pygame.time.Clock()
|
||||||
|
|
||||||
|
start = False
|
||||||
|
|
||||||
# -------- Glowna petla programu -----------
|
# -------- Glowna petla programu -----------
|
||||||
while not done:
|
while not done:
|
||||||
|
|
||||||
@ -55,7 +57,14 @@ def game():
|
|||||||
print("Click ", pozycja_myszki,
|
print("Click ", pozycja_myszki,
|
||||||
"Grid coordinates: ", wiersz, kolumna)
|
"Grid coordinates: ", wiersz, kolumna)
|
||||||
obiekty["plansza"][kolumna,wiersz].setKolor(BLACK)
|
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()
|
obiekty["smieciarka"].rand_move()
|
||||||
clock.tick(7)
|
clock.tick(7)
|
||||||
pygame.quit()
|
pygame.quit()
|
||||||
|
Loading…
Reference in New Issue
Block a user