2020-04-07 21:57:12 +02:00
|
|
|
import pygame, sys
|
2020-04-07 21:28:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pygame.init()
|
|
|
|
screen = pygame.display.set_mode((1280,720))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Uprawy:
|
|
|
|
rodzajUprawy="brak"
|
|
|
|
czyPodlac="nie"
|
|
|
|
czyPodacNawoz="nie"
|
|
|
|
stanUprawy="dobry"
|
|
|
|
|
|
|
|
marchew = Uprawy()
|
|
|
|
marchew.rodzajUprawy="Marchew"
|
|
|
|
marchew.czyPodlac="tak"
|
|
|
|
marchew.czyPodacNawoz="tak"
|
|
|
|
marchew.stanUprawy="sredni"
|
|
|
|
|
|
|
|
ziemniaki = Uprawy()
|
|
|
|
ziemniaki.rodzajUprawy="Ziemniak"
|
|
|
|
ziemniaki.czyPodlac="tak"
|
|
|
|
ziemniaki.czyPodacNawoz="nie"
|
|
|
|
ziemniaki.stanUprawy="dobry"
|
|
|
|
|
|
|
|
buraki = Uprawy()
|
|
|
|
buraki.rodzajUprawy="Burak"
|
|
|
|
buraki.czyPodlac="nie"
|
|
|
|
buraki.czyPodacNawoz="nie"
|
|
|
|
buraki.stanUprawy="bardzo dobry"
|
|
|
|
|
|
|
|
salata = Uprawy()
|
|
|
|
salata.rodzajUprawy="Salata"
|
|
|
|
salata.czyPodlac="tak"
|
|
|
|
salata.czyPodacNawoz="tak"
|
|
|
|
salata.stanUprawy="zly"
|
|
|
|
|
|
|
|
pomidory = Uprawy()
|
|
|
|
pomidory.rodzajUprawy="Pomidor"
|
|
|
|
pomidory.czyPodlac="nie"
|
|
|
|
pomidory.czyPodacNawoz="tak"
|
|
|
|
pomidory.stanUprawy="sredni"
|
|
|
|
|
|
|
|
|
2020-04-07 21:42:19 +02:00
|
|
|
image = pygame.image.load(r'traktor.jpg')
|
2020-04-07 21:28:57 +02:00
|
|
|
x=0
|
|
|
|
y=0
|
|
|
|
white = (255, 255, 255)
|
|
|
|
screen.fill(white)
|
|
|
|
def traktor(x,y):
|
|
|
|
screen.blit(image, (x,y))
|
|
|
|
while True:
|
|
|
|
for event in pygame.event.get():
|
|
|
|
if event.type==pygame.QUIT:
|
|
|
|
sys.exit(0)
|
2020-04-07 21:57:12 +02:00
|
|
|
|
2020-04-07 21:28:57 +02:00
|
|
|
if x <1200 and y==0:
|
|
|
|
x+=1
|
|
|
|
elif x==1200 and y<650:
|
|
|
|
y+=1
|
|
|
|
elif x>600 and y==650:
|
|
|
|
x-=1
|
2020-04-07 21:57:12 +02:00
|
|
|
elif x==600 and y>0:
|
2020-04-07 21:28:57 +02:00
|
|
|
y-=1
|
|
|
|
|
|
|
|
|
2020-04-07 21:57:12 +02:00
|
|
|
|
2020-04-07 21:28:57 +02:00
|
|
|
screen.fill(white)
|
|
|
|
traktor(x,y)
|
|
|
|
pygame.display.flip()
|