dodana obsluga przyciskow 'q' i 's'
This commit is contained in:
parent
cc6fdc2e8b
commit
1dc9e45f19
11
game.py
11
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,8 +57,15 @@ 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
|
||||||
|
|
||||||
obiekty["smieciarka"].rand_move()
|
if start:
|
||||||
|
obiekty["smieciarka"].rand_move()
|
||||||
clock.tick(7)
|
clock.tick(7)
|
||||||
pygame.quit()
|
pygame.quit()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user