From f76b5e4613aa59cc02643f75c19b17d715cd2cb5 Mon Sep 17 00:00:00 2001 From: s444504 Date: Tue, 7 Apr 2020 21:28:57 +0200 Subject: [PATCH] first commit --- run.py | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 run.py diff --git a/run.py b/run.py new file mode 100644 index 0000000..4cec186 --- /dev/null +++ b/run.py @@ -0,0 +1,85 @@ +import pygame, sys,random + + + +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'C:\Users\Natalia\Desktop\unnamed.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) + elif event.type == pygame.KEYDOWN and event.key == pygame.K_SPACE: + x += 50 + + #if random.randint(1, 4)==1: + # box.x+=2 + #elif random.randint(1, 4)==2: + # box.y+=2 + #elif random.randint(1, 4)==3: + # box.x-=2 + #elif random.randint(1, 4)==4: + # box.y-=2 + 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>1: + y-=1 + elif y==1 and 00: + y-=1 + + + screen.fill(white) + traktor(x,y) + pygame.display.flip()