Madra_smieciarka/generators.py
Neerka e02adf16b6 grid works + little adjustments
Signed-off-by: Neerka <jakub.markil1@gmail.com>
2024-03-25 14:26:41 +01:00

47 lines
1.8 KiB
Python

from classes.Trashcan import *
from classes.Household import *
from classes.Garbagetruck import *
from classes.Tilemap import *
from classes.Tileset import *
from QOLfunc import *
import pygame
def trashcanGenerator() -> list:
typelist = ["paper", "metals_and_plastics", "mixed", "bio_waste", "glass"]
trash_cans = [
{'position': (1, 0), 'type': 'paper'},
{'position': (1, 1), 'type': 'metals_and_plastics'},
{'position': (1, 2), 'type': 'mixed'},
{'position': (1, 3), 'type': 'bio_waste'},
{'position': (1, 4), 'type': 'glass'},
]
trash_can_images = {
'paper': pygame.image.load('sprites/trash_can_papier.jpg').convert_alpha(),
'metals_and_plastics': pygame.image.load('sprites/trash_can_metale_plastik.jpg').convert_alpha(),
'mixed': pygame.image.load('sprites/trash_can_zmieszane.jpg').convert_alpha(),
'bio_waste': pygame.image.load('sprites/trash_can_bio.jpg').convert_alpha(),
'glass': pygame.image.load('sprites/trash_can_szklo.jpg').convert_alpha(),
}
trashcans = []
for key in trash_can_images:
trash_can_images[key] = pygame.transform.scale(trash_can_images[key], (32,32))
for i in range(5):
trashcan = generateTrashcan(i, trash_can_images[typelist[i]], trash_cans[i]["position"], trash_cans[i]["type"])
trashcans.append(trashcan)
return trashcans
def householdGenerator():
new_house_size = (32, 32)
house_positions = [(15, 5), (17, 5), (19, 5), (21, 5), (15, 8), (17, 8), (19, 8), (21, 8)]
houses = []
for i in range(8):
house_image = pygame.image.load(f'sprites/domek.png')
house_image = pygame.transform.scale(house_image, new_house_size)
house = generateHousehold(i, house_image, house_positions[i])
houses.append(house)
return houses