From c7d6842d5140f7e6251ed524482c549c593d87ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kinga=20Jagodzi=C5=84ska?= Date: Tue, 28 Apr 2020 23:01:06 +0000 Subject: [PATCH] Zaktualizuj 'Traktorek/Tractor.py' --- Traktorek/Tractor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Traktorek/Tractor.py b/Traktorek/Tractor.py index 318b7e4..4815e95 100644 --- a/Traktorek/Tractor.py +++ b/Traktorek/Tractor.py @@ -32,8 +32,10 @@ class Tractor(object): if pygame.key.get_pressed()[pygame.K_SPACE]: # obecne pole - self.pole = self.pos.y // 144 * 5 + self.pos.x // 144 + pole = self.pos.y // 144 * 5 + self.pos.x // 144 + if len(self.road) == 0: + sys.exit(0) if self.road[0] == self.pole + 1: self.pos.x = self.pos.x + 144 elif self.road[0] == self.pole - 1: