73 lines
1.3 KiB
Python
73 lines
1.3 KiB
Python
import pygame, sys
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
|
image = pygame.image.load(r'traktor.jpg')
|
|
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)
|
|
|
|
if x <1200 and y==0:
|
|
x+=1
|
|
elif x==1200 and y<650:
|
|
y+=1
|
|
elif x>600 and y==650:
|
|
x-=1
|
|
elif x==600 and y>0:
|
|
y-=1
|
|
|
|
|
|
|
|
screen.fill(white)
|
|
traktor(x,y)
|
|
pygame.display.flip()
|