V1.34
This commit is contained in:
parent
e2c69cd3b9
commit
bad695ca49
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
from TractorLoad import TillageUnit
|
from TractorLoad import TillageUnit
|
||||||
|
|
||||||
|
|
||||||
@ -18,19 +17,20 @@ def action(field, tractor):
|
|||||||
elif isinstance(tractor.hitch, TillageUnit) and tractor.hitch.load == "Fertilizer" and field.state == "toFertilize":
|
elif isinstance(tractor.hitch, TillageUnit) and tractor.hitch.load == "Fertilizer" and field.state == "toFertilize":
|
||||||
return "toCut"
|
return "toCut"
|
||||||
|
|
||||||
|
|
||||||
def chooseToolset(tractor, tillageUnit, set):
|
def chooseToolset(tractor, tillageUnit, set):
|
||||||
if set == 0:
|
if set == 0:
|
||||||
tractor.hitch = tillageUnit
|
tractor.hitch = tillageUnit
|
||||||
tractor.hitch.load = "Nothing"
|
tractor.hitch.load = "Nothing"
|
||||||
if set == 1:
|
if set == 1:
|
||||||
tractor.hitch = tillageUnit
|
tractor.hitch = tillageUnit
|
||||||
tractor.hitch.load = "Fertilizer"
|
tractor.hitch.load = "Water"
|
||||||
if set == 2:
|
if set == 2:
|
||||||
tractor.hitch = tillageUnit
|
tractor.hitch = tillageUnit
|
||||||
tractor.hitch.load = "Seeds"
|
tractor.hitch.load = "Seeds"
|
||||||
if set == 3:
|
if set == 3:
|
||||||
tractor.hitch = tillageUnit
|
tractor.hitch = tillageUnit
|
||||||
tractor.hitch.load = "Water"
|
tractor.hitch.load = "Fertilizer"
|
||||||
if set == 4:
|
if set == 4:
|
||||||
tractor.header = True
|
tractor.header = True
|
||||||
tractor.hitch = "Crop Trailer"
|
tractor.hitch = "Crop Trailer"
|
||||||
|
35
drawUI.py
35
drawUI.py
@ -5,11 +5,11 @@ import pygame
|
|||||||
|
|
||||||
|
|
||||||
def drawUI(board, display, tractor, direction, tillageUnit, field):
|
def drawUI(board, display, tractor, direction, tillageUnit, field):
|
||||||
|
for i in range(1, 11):
|
||||||
display.fill(WHITE)
|
display.fill(WHITE)
|
||||||
makeField(board, display)
|
makeField(board, display)
|
||||||
drawTractor(display, tractor.horizontal_index, tractor.vertical_index, direction)
|
drawTractor(display, tractor.horizontal_index, tractor.vertical_index, direction, i)
|
||||||
drawInfo(display, tractor, tillageUnit, field)
|
drawInfo(display, tractor, tillageUnit, field)
|
||||||
|
|
||||||
pygame.display.update()
|
pygame.display.update()
|
||||||
|
|
||||||
|
|
||||||
@ -57,14 +57,25 @@ def makeField(board, screen: pygame.Surface):
|
|||||||
screen.blit(to_fertilizer, to_fertilizer_rect)
|
screen.blit(to_fertilizer, to_fertilizer_rect)
|
||||||
|
|
||||||
|
|
||||||
def drawTractor(screen: pygame.Surface, tractor_horizontal_index, tractor_vertical_index, direction):
|
def drawTractor(screen: pygame.Surface, tractor_horizontal_index, tractor_vertical_index, direction, i):
|
||||||
|
tractor_pic = tractor_up
|
||||||
|
horizontal = tractor_horizontal_index * TILE_SIZE
|
||||||
|
vertical = tractor_vertical_index * TILE_SIZE
|
||||||
|
|
||||||
|
|
||||||
|
i = i/10
|
||||||
|
|
||||||
if direction == "UP":
|
if direction == "UP":
|
||||||
screen.blit(tractor_up, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE))
|
tractor_pic = tractor_up
|
||||||
elif direction == "DOWN":
|
vertical = vertical - (TILE_SIZE * i)
|
||||||
screen.blit(tractor_down, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE))
|
if direction == "DOWN":
|
||||||
elif direction == "LEFT":
|
tractor_pic = tractor_down
|
||||||
screen.blit(tractor_left, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE))
|
vertical = vertical + (TILE_SIZE * i)
|
||||||
elif direction == "RIGHT":
|
if direction == "LEFT":
|
||||||
screen.blit(tractor_right, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE))
|
tractor_pic = tractor_left
|
||||||
else:
|
horizontal = horizontal - (TILE_SIZE * i)
|
||||||
screen.blit(tractor_right, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE))
|
if direction == "RIGHT":
|
||||||
|
tractor_pic = tractor_right
|
||||||
|
horizontal = horizontal + (TILE_SIZE * i)
|
||||||
|
|
||||||
|
screen.blit(tractor_pic, (horizontal, vertical))
|
||||||
|
Loading…
Reference in New Issue
Block a user