SterowanieManualnePrzeniesione
This commit is contained in:
parent
e121af6630
commit
ac55e5bf57
@ -98,7 +98,6 @@ class Tractor:
|
||||
self.__direction = direction
|
||||
|
||||
|
||||
|
||||
def drive(self):
|
||||
mRange = 1
|
||||
if not self.__engineWorking:
|
||||
|
@ -29,7 +29,7 @@ TRACTOR_WIDTH = TILE_SIZE
|
||||
TRACTOR_HEIGHT = TILE_SIZE
|
||||
|
||||
#FRAMES PER SECOND
|
||||
FPS = 10
|
||||
FPS = 1
|
||||
|
||||
#ANIMATION_PART
|
||||
|
||||
|
7
main.py
7
main.py
@ -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()
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user