v 1.23
This commit is contained in:
parent
9b75da63ac
commit
087cb6031d
@ -63,7 +63,7 @@ class Tractor:
|
||||
|
||||
@header.setter
|
||||
def header(self, header):
|
||||
if header is True or False:
|
||||
if header is True or header is False:
|
||||
self.__header = header
|
||||
|
||||
@property
|
||||
|
14
main.py
14
main.py
@ -18,7 +18,7 @@ lastDirection = "RIGHT"
|
||||
|
||||
horizontal_change = 0
|
||||
vertical_change = 0
|
||||
|
||||
hitchCounter = 0
|
||||
board = Board.generate()
|
||||
|
||||
tractor = Tractor(horizontal_index=0, vertical_index=0, hitch="nothing", header=False)
|
||||
@ -33,13 +33,21 @@ while working:
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_SPACE:
|
||||
field = board[tractor.horizontal_index][tractor.vertical_index]
|
||||
print(action(field, tractor))
|
||||
field.state = action(field, tractor)
|
||||
#print(field.state)
|
||||
if event.key == pygame.K_q:
|
||||
hitchCounter = (hitchCounter + 1) % 3
|
||||
if hitchCounter == 0:
|
||||
tractor.hitch = "Crop Trailer"
|
||||
if hitchCounter == 1:
|
||||
tractor.hitch = "Tillage Unit"
|
||||
if hitchCounter == 2:
|
||||
tractor.hitch = "Nothing"
|
||||
if event.key == pygame.K_w:
|
||||
if tractor.header:
|
||||
tractor.header = False
|
||||
else:
|
||||
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