Zaktualizuj 'Traktorek/Tractor.py'

This commit is contained in:
Kinga Jagodzińska 2020-04-28 19:43:27 +00:00
parent a3d17be18d
commit 1e3b935c43

View File

@ -24,7 +24,6 @@ class Tractor(object):
#ruszanie się #ruszanie się
self.road = self.algo(0, 24) self.road = self.algo(0, 24)
# obecne pole
def tick(self): def tick(self):
@ -32,7 +31,9 @@ class Tractor(object):
# input # input
if pygame.key.get_pressed()[pygame.K_SPACE]: if pygame.key.get_pressed()[pygame.K_SPACE]:
# obecne pole
self.pole = self.pos.y // 144 * 5 + self.pos.x // 144 self.pole = self.pos.y // 144 * 5 + self.pos.x // 144
if self.road[0] == self.pole + 1: if self.road[0] == self.pole + 1:
self.pos.x = self.pos.x + 144 self.pos.x = self.pos.x + 144
elif self.road[0] == self.pole - 1: elif self.road[0] == self.pole - 1: