dodanie czesci ikonek warzyw
BIN
src/images/vegetables/cebula.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
BIN
src/images/vegetables/dynia.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
src/images/vegetables/marchew.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
src/images/vegetables/por.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
src/images/vegetables/rzodkiewka.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
src/images/vegetables/sałata.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
src/images/vegetables/ziemniak.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
10
src/tile.py
@ -28,10 +28,20 @@ class Tile(pygame.sprite.Sprite):
|
|||||||
def draw(self, surface):
|
def draw(self, surface):
|
||||||
self.tiles.draw(surface)
|
self.tiles.draw(surface)
|
||||||
|
|
||||||
|
def set_type(self, type):
|
||||||
|
self.type = type
|
||||||
|
image_path = f"images/vegetables/{self.type}.png"
|
||||||
|
if os.path.exists(image_path):
|
||||||
|
self.image = pygame.image.load(image_path).convert()
|
||||||
|
else:
|
||||||
|
self.image = pygame.image.load("images/grass.png").convert()
|
||||||
|
self.image = pygame.transform.scale(self.image, (TILE_SIZE, TILE_SIZE))
|
||||||
|
|
||||||
|
'''
|
||||||
def set_type(self, type):
|
def set_type(self, type):
|
||||||
self.type = type
|
self.type = type
|
||||||
# if self.type == 'grass':
|
# if self.type == 'grass':
|
||||||
# self.image = pygame.image.load("images/grass.png").convert()
|
# self.image = pygame.image.load("images/grass.png").convert()
|
||||||
self.image = pygame.image.load("images/grass.png").convert()
|
self.image = pygame.image.load("images/grass.png").convert()
|
||||||
self.image = pygame.transform.scale(self.image, (TILE_SIZE, TILE_SIZE))
|
self.image = pygame.transform.scale(self.image, (TILE_SIZE, TILE_SIZE))
|
||||||
|
'''
|