diff --git a/drawUI.py b/drawUI.py index 0c47dec..917f0c5 100644 --- a/drawUI.py +++ b/drawUI.py @@ -5,12 +5,12 @@ import pygame def drawUI(board, display, tractor, direction, tillageUnit, field): - for i in range(1, 21): - display.fill(WHITE) - makeField(board, display) - drawTractor(display, tractor.horizontal_index, tractor.vertical_index, direction, i) - drawInfo(display, tractor, tillageUnit, field) - pygame.display.update() + display.fill(WHITE) + makeField(board, display) + drawTractor(display, tractor.horizontal_index, tractor.vertical_index, direction) + drawInfo(display, tractor, tillageUnit, field) + + pygame.display.update() def drawInfo(display, tractor, tillageUnit, field): @@ -57,25 +57,14 @@ def makeField(board, screen: pygame.Surface): screen.blit(to_fertilizer, to_fertilizer_rect) -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 - +def drawTractor(screen: pygame.Surface, tractor_horizontal_index, tractor_vertical_index, direction): if direction == "UP": - tractor_pic = tractor_up - vertical = vertical + (TILE_SIZE * i) - if direction == "DOWN": - tractor_pic = tractor_down - vertical = vertical - (TILE_SIZE * i) - if direction == "LEFT": - tractor_pic = tractor_left - horizontal = horizontal + (TILE_SIZE * i) - if direction == "RIGHT": - tractor_pic = tractor_right - horizontal = horizontal - (TILE_SIZE * i) - - screen.blit(tractor_pic, (horizontal, vertical)) + screen.blit(tractor_up, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE)) + elif direction == "DOWN": + screen.blit(tractor_down, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE)) + elif direction == "LEFT": + screen.blit(tractor_left, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE)) + elif direction == "RIGHT": + screen.blit(tractor_right, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE)) + else: + screen.blit(tractor_right, (tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE)) diff --git a/resources/fuel.png b/resources/fuel.png new file mode 100644 index 0000000..cbe147f Binary files /dev/null and b/resources/fuel.png differ diff --git a/resources/to_cut.png b/resources/to_cut.png new file mode 100644 index 0000000..25e68af Binary files /dev/null and b/resources/to_cut.png differ diff --git a/resources/to_fertilizer.png b/resources/to_fertilizer.png new file mode 100644 index 0000000..dd21444 Binary files /dev/null and b/resources/to_fertilizer.png differ diff --git a/resources/to_plow.png b/resources/to_plow.png new file mode 100644 index 0000000..e66b26e Binary files /dev/null and b/resources/to_plow.png differ diff --git a/resources/to_seed.png b/resources/to_seed.png new file mode 100644 index 0000000..4cd87ec Binary files /dev/null and b/resources/to_seed.png differ diff --git a/resources/to_water.png b/resources/to_water.png new file mode 100644 index 0000000..5231b6c Binary files /dev/null and b/resources/to_water.png differ diff --git a/resources/tools.png b/resources/tools.png new file mode 100644 index 0000000..fe36411 Binary files /dev/null and b/resources/tools.png differ diff --git a/resources/tractor_down.png b/resources/tractor_down.png new file mode 100644 index 0000000..7dc59a1 Binary files /dev/null and b/resources/tractor_down.png differ diff --git a/resources/tractor_left.png b/resources/tractor_left.png new file mode 100644 index 0000000..f41923c Binary files /dev/null and b/resources/tractor_left.png differ diff --git a/resources/tractor_right.png b/resources/tractor_right.png new file mode 100644 index 0000000..7d79261 Binary files /dev/null and b/resources/tractor_right.png differ diff --git a/resources/tractor_up.png b/resources/tractor_up.png new file mode 100644 index 0000000..295d5bf Binary files /dev/null and b/resources/tractor_up.png differ