updated graphics

This commit is contained in:
Łukasz 2021-03-29 21:40:55 +02:00
parent b32d77fe3f
commit 9af7e0d421
11 changed files with 44 additions and 31 deletions

View File

@ -6,18 +6,17 @@ def action(field, tractor):
if tractor.header and tractor.hitch == "Crop Trailer" and field.state == "toCut":
return "toPlow"
elif isinstance(tractor.hitch, TillageUnit) and tractor.hitch.load == "Fertilizer" and field.state == "toFertilize":
return "toSeed"
elif isinstance(tractor.hitch, TillageUnit) and tractor.hitch.load == "Seeds" and field.state == "toSeed":
elif isinstance(tractor.hitch, TillageUnit) and tractor.hitch.load == "Nothing" and field.state == "toPlow":
return "toWater"
elif isinstance(tractor.hitch, TillageUnit) and tractor.hitch.load == "Water" and field.state == "toWater":
return "toCut"
return "toSeed"
elif isinstance(tractor.hitch, TillageUnit) and tractor.hitch.load == "Nothing" and field.state == "toPlow":
elif isinstance(tractor.hitch, TillageUnit) and tractor.hitch.load == "Seeds" and field.state == "toSeed":
return "toFertilize"
elif isinstance(tractor.hitch, TillageUnit) and tractor.hitch.load == "Fertilizer" and field.state == "toFertilize":
return "toCut"
def chooseToolset(tractor, tillageUnit, set):
if set == 0:

View File

@ -41,17 +41,20 @@ def makeField(board, screen: pygame.Surface):
pos_y = j * TILE_SIZE + TILE_SIZE // 2
if field.state == "toWater":
do_podlania_rect.center = (pos_x, pos_y)
screen.blit(do_podlania, do_podlania_rect)
to_water_rect.center = (pos_x, pos_y)
screen.blit(to_water, to_water_rect)
elif field.state == "toPlow":
do_zaorania_rect.center = (pos_x, pos_y)
screen.blit(do_zaorania, do_zaorania_rect)
to_plow_rect.center = (pos_x, pos_y)
screen.blit(to_plow, to_plow_rect)
elif field.state == "toSeed":
do_zasiania_rect.center = (pos_x, pos_y)
screen.blit(do_zasiania, do_zasiania_rect)
to_seed_rect.center = (pos_x, pos_y)
screen.blit(to_seed, to_seed_rect)
elif field.state == "toCut":
do_zebrania_rect.center = (pos_x, pos_y)
screen.blit(do_zebrania, do_zebrania_rect)
to_cut_rect.center = (pos_x, pos_y)
screen.blit(to_cut, to_cut_rect)
elif field.state == "toFertilize":
to_fertilizer_rect.center = (pos_x, pos_y)
screen.blit(to_fertilizer, to_fertilizer_rect)
def drawTractor(screen: pygame.Surface, tractor_horizontal_index, tractor_vertical_index, direction):

View File

@ -1,37 +1,48 @@
import pygame
from constants import *
from constants import TILE_SIZE
tractor_up_image = pygame.image.load("resources/traktor_up.png")
tractor_up_image = pygame.image.load("resources/tractor_up.png")
tractor_up = pygame.transform.scale(tractor_up_image, (TILE_SIZE, TILE_SIZE))
tractor_right_image = pygame.image.load("resources/traktor_right.png")
tractor_right_image = pygame.image.load("resources/tractor_right.png")
tractor_right = pygame.transform.scale(tractor_right_image, (TILE_SIZE, TILE_SIZE))
tractor_down_image = pygame.image.load("resources/traktor_down.png")
tractor_down_image = pygame.image.load("resources/tractor_down.png")
tractor_down = pygame.transform.scale(tractor_down_image, (TILE_SIZE, TILE_SIZE))
tractor_left_image = pygame.image.load("resources/traktor_left.png")
tractor_left_image = pygame.image.load("resources/tractor_left.png")
tractor_left = pygame.transform.scale(tractor_left_image, (TILE_SIZE, TILE_SIZE))
do_podlania_image = pygame.image.load("resources/do_podlania.png")
do_podlania = pygame.transform.scale(do_podlania_image, (TILE_SIZE, TILE_SIZE))
to_water_image = pygame.image.load("resources/to_water.png")
to_water = pygame.transform.scale(to_water_image, (TILE_SIZE, TILE_SIZE))
do_zaorania_image = pygame.image.load("resources/do_zaorania.png")
do_zaorania = pygame.transform.scale(do_zaorania_image, (TILE_SIZE, TILE_SIZE))
to_plow_image = pygame.image.load("resources/to_plow.png")
to_plow = pygame.transform.scale(to_plow_image, (TILE_SIZE, TILE_SIZE))
do_zasiania_image = pygame.image.load("resources/do_zasiania.png")
do_zasiania = pygame.transform.scale(do_zasiania_image, (TILE_SIZE, TILE_SIZE))
to_seed_image = pygame.image.load("resources/to_seed.png")
to_seed = pygame.transform.scale(to_seed_image, (TILE_SIZE, TILE_SIZE))
do_zebrania_image = pygame.image.load("resources/do_zebrania.png")
do_zebrania = pygame.transform.scale(do_zebrania_image, (TILE_SIZE, TILE_SIZE))
to_cut_image = pygame.image.load("resources/to_cut.png")
to_cut = pygame.transform.scale(to_cut_image, (TILE_SIZE, TILE_SIZE))
to_fertilizer_image = pygame.image.load("resources/to_fertilizer.png")
to_fertilizer = pygame.transform.scale(to_fertilizer_image, (TILE_SIZE, TILE_SIZE))
fuel_image = pygame.image.load("resources/fuel.png")
fuel = pygame.transform.scale(fuel_image, (TILE_SIZE, TILE_SIZE))
tools_image = pygame.image.load("resources/tools.png")
tools = pygame.transform.scale(tools_image, (TILE_SIZE, TILE_SIZE))
tractor_up_rect = tractor_up.get_rect()
tractor_right_rect = tractor_right.get_rect()
tractor_down_rect = tractor_down.get_rect()
tractor_left_rect = tractor_left.get_rect()
do_podlania_rect = do_podlania.get_rect()
do_zaorania_rect = do_zaorania.get_rect()
do_zasiania_rect = do_zasiania.get_rect()
do_zebrania_rect = do_zebrania.get_rect()
to_water_rect = to_water.get_rect()
to_plow_rect = to_plow.get_rect()
to_seed_rect = to_seed.get_rect()
to_cut_rect = to_cut.get_rect()
to_fertilizer_rect = to_fertilizer.get_rect()
fuel_rect = fuel.get_rect()
tools_rect = tools.get_rect()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB