diff --git a/main.py b/main.py index 36d4e67..02435e3 100644 --- a/main.py +++ b/main.py @@ -41,7 +41,8 @@ while working: if event.type == pygame.QUIT: working = False if event.type == pygame.KEYDOWN: - manualSteeringDriver(event, board, tractor, hitchCounter, tillageUnit, loadCounter, ANIMATION_PART) + hitchCounter, loadCounter, animationSpeed = \ + manualSteeringDriver(event, board, tractor, hitchCounter, tillageUnit, loadCounter, animationSpeed) field = board[tractor.horizontal_index][tractor.vertical_index] diff --git a/manualSteering.py b/manualSteering.py index 9233905..fae065c 100644 --- a/manualSteering.py +++ b/manualSteering.py @@ -3,7 +3,7 @@ from constants import * from TractorAction import action import pygame -def manualSteeringDriver(event, board, tractor, hitchCounter, tillageUnit, loadCounter, ANIMATION_PART): +def manualSteeringDriver(event, board, tractor, hitchCounter, tillageUnit, loadCounter, animationSpeed): if event.key == pygame.K_SPACE: field = board[tractor.horizontal_index][tractor.vertical_index] field.state = action(field, tractor) @@ -38,17 +38,14 @@ def manualSteeringDriver(event, board, tractor, hitchCounter, tillageUnit, loadC if event.key == pygame.K_t: if tractor.autodrive: tractor.autodrive = False - cruiseControl = False - autoAction = False animationSpeed = 1 else: tractor.autodrive = True animationSpeed = ANIMATION_PART - cruiseControl = True - autoAction = True manualTurning(event, tractor) + return hitchCounter, loadCounter, animationSpeed def manualTurning(event, tractor): tractor.direction = "STOP"