updated graphics

This commit is contained in:
Łukasz 2021-03-29 21:46:40 +02:00
parent 41272aea6e
commit e2c69cd3b9
12 changed files with 16 additions and 27 deletions

View File

@ -5,12 +5,12 @@ 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)
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()
def drawInfo(display, tractor, tillageUnit, field): def drawInfo(display, tractor, tillageUnit, field):
@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
resources/to_cut.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
resources/to_fertilizer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
resources/to_plow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
resources/to_seed.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
resources/to_water.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
resources/tools.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
resources/tractor_down.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
resources/tractor_left.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
resources/tractor_right.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
resources/tractor_up.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB