v. 1.10
This commit is contained in:
parent
91106af2a8
commit
9b75da63ac
2
Field.py
2
Field.py
@ -10,5 +10,5 @@ class Field:
|
||||
|
||||
@state.setter
|
||||
def state(self, state):
|
||||
if state == 0 or state == 1 or state == 2 or state == 3 or state == 4:
|
||||
if state == "toPlow" or state == "toWater" or state == "toSeed" or state == "toFertilize" or state == "toCut":
|
||||
self.__state = state
|
||||
|
@ -2,7 +2,6 @@ from Main import TractorLoad
|
||||
|
||||
|
||||
def action(field, tractor):
|
||||
|
||||
if tractor.header and tractor.hitch == "Crop Trailer":
|
||||
return "toPlow"
|
||||
|
||||
@ -17,5 +16,3 @@ def action(field, tractor):
|
||||
|
||||
elif tractor.hitch == "Tillage Unit" and TractorLoad.TillageUnitLoad == "None":
|
||||
return "toFertilize"
|
||||
|
||||
|
||||
|
8
main.py
8
main.py
@ -33,7 +33,13 @@ while working:
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_SPACE:
|
||||
field = board[tractor.horizontal_index][tractor.vertical_index]
|
||||
field = action(field, tractor)
|
||||
print(action(field, tractor))
|
||||
field.state = action(field, tractor)
|
||||
#print(field.state)
|
||||
if event.key == pygame.K_q:
|
||||
tractor.hitch = "Crop Trailer"
|
||||
if event.key == pygame.K_w:
|
||||
tractor.header = True
|
||||
horizontal_change, vertical_change = driving.manualTurning(event, tractor.horizontal_index,
|
||||
tractor.vertical_index, horizontal_change,
|
||||
vertical_change)
|
||||
|
Loading…
Reference in New Issue
Block a user