SterowanieManualnePrzeniesione

This commit is contained in:
secret_dude 2021-04-13 18:40:58 +02:00
parent e121af6630
commit ac55e5bf57
4 changed files with 6 additions and 6 deletions

View File

@ -98,7 +98,6 @@ class Tractor:
self.__direction = direction
def drive(self):
mRange = 1
if not self.__engineWorking:

View File

@ -29,7 +29,7 @@ TRACTOR_WIDTH = TILE_SIZE
TRACTOR_HEIGHT = TILE_SIZE
#FRAMES PER SECOND
FPS = 10
FPS = 1
#ANIMATION_PART

View File

@ -9,8 +9,6 @@ from TractorLoad import TillageUnit
from constants import *
from manualSteering import manualSteeringDriver
# wersja 1.05
pygame.init()
display = pygame.display.set_mode((DISPLAY_SIZE_HORIZONTAL, DISPLAY_SIZE_VERTICAL))
@ -49,14 +47,15 @@ while working:
if autoAction:
tractor, tillageUnit, toolCounter = TractorAction.autoAction(tractor, tillageUnit, toolCounter)
field.state = action(field, tractor)
if tractor.engineWorking:
tractor.reduce_fuel()
tractor.drive()
drawUI.drawUI(board, display, tractor, tractor.direction, tillageUnit, field, animationSpeed)
clock.tick(FPS)
if tractor.engineWorking:
tractor.reduce_fuel()
pygame.quit()
quit()

View File

@ -33,8 +33,10 @@ def manualSteeringDriver(event, board, tractor, hitchCounter, tillageUnit, loadC
if event.key == pygame.K_r:
if tractor.engineWorking:
tractor.turnOffEngine()
animationSpeed = 1
else:
tractor.turnOnEngine()
animationSpeed = ANIMATION_PART
if event.key == pygame.K_t:
if tractor.autodrive:
tractor.autodrive = False