updated graphics
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, 21):
|
|
||||||
display.fill(WHITE)
|
display.fill(WHITE)
|
||||||
makeField(board, display)
|
makeField(board, display)
|
||||||
drawTractor(display, tractor.horizontal_index, tractor.vertical_index, direction, i)
|
drawTractor(display, tractor.horizontal_index, tractor.vertical_index, direction)
|
||||||
drawInfo(display, tractor, tillageUnit, field)
|
drawInfo(display, tractor, tillageUnit, field)
|
||||||
|
|
||||||
pygame.display.update()
|
pygame.display.update()
|
||||||
|
|
||||||
|
|
||||||
@ -57,25 +57,14 @@ 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, i):
|
def drawTractor(screen: pygame.Surface, tractor_horizontal_index, tractor_vertical_index, direction):
|
||||||
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":
|
||||||
tractor_pic = tractor_up
|
screen.blit(tractor_up, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE))
|
||||||
vertical = vertical + (TILE_SIZE * i)
|
elif direction == "DOWN":
|
||||||
if direction == "DOWN":
|
screen.blit(tractor_down, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE))
|
||||||
tractor_pic = tractor_down
|
elif direction == "LEFT":
|
||||||
vertical = vertical - (TILE_SIZE * i)
|
screen.blit(tractor_left, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE))
|
||||||
if direction == "LEFT":
|
elif direction == "RIGHT":
|
||||||
tractor_pic = tractor_left
|
screen.blit(tractor_right, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE))
|
||||||
horizontal = horizontal + (TILE_SIZE * i)
|
else:
|
||||||
if direction == "RIGHT":
|
screen.blit(tractor_right, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE))
|
||||||
tractor_pic = tractor_right
|
|
||||||
horizontal = horizontal - (TILE_SIZE * i)
|
|
||||||
|
|
||||||
screen.blit(tractor_pic, (horizontal, vertical))
|
|
||||||
|
BIN
resources/fuel.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
resources/to_cut.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
resources/to_fertilizer.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
resources/to_plow.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
resources/to_seed.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
resources/to_water.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
resources/tools.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
resources/tractor_down.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
resources/tractor_left.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
resources/tractor_right.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
resources/tractor_up.png
Normal file
After Width: | Height: | Size: 30 KiB |