Zmiana pogody pod F4
This commit is contained in:
parent
d7deb4900c
commit
81fe6f66ee
6
field.py
6
field.py
@ -44,6 +44,7 @@ class field():
|
||||
|
||||
def pogoda(self):
|
||||
number = random.randrange(0, 4)
|
||||
print(number)
|
||||
return number
|
||||
|
||||
def get_pogoda_value(self):
|
||||
@ -57,4 +58,7 @@ class field():
|
||||
elif self.weather==2:
|
||||
return 'grad'
|
||||
elif self.weather==3:
|
||||
return 'zachmurzenie'
|
||||
return 'zachmurzenie'
|
||||
|
||||
def change_weather(self):
|
||||
self.weather = self.pogoda()
|
4
main.py
4
main.py
@ -42,6 +42,10 @@ while True:
|
||||
traktor.set_mode(3)
|
||||
if key[K_p]:
|
||||
path.pathfinding(traktor,pole,UI)
|
||||
if key[K_F4]:
|
||||
#Zmiana pogody
|
||||
pole.change_weather()
|
||||
UI.pogoda()
|
||||
if key[K_F5]:
|
||||
#Dla projektu Justyny
|
||||
j.main()
|
||||
|
5
ui.py
5
ui.py
@ -64,4 +64,7 @@ class game_ui():
|
||||
self.traktor_actual_img = pygame.image.load('images/' + self.traktor_img[self.traktor.get_turn()])
|
||||
self.okno.blit(self.traktor_actual_img,self.traktor.get_poz_on_screen())
|
||||
# aktualizacja okna i wyświetlenie
|
||||
pygame.display.update()
|
||||
pygame.display.update()
|
||||
|
||||
def pogoda(self):
|
||||
self.text_weather = "Pogoda: "+self.field.get_pogoda_name()
|
||||
|
Loading…
Reference in New Issue
Block a user