2024-03-19 21:08:24 +01:00
|
|
|
from classes.Trashcan import *
|
|
|
|
from classes.Household import *
|
2024-03-25 00:05:56 +01:00
|
|
|
from classes.Garbagetruck import *
|
2024-03-25 11:21:23 +01:00
|
|
|
from classes.Tilemap import *
|
|
|
|
from classes.Tileset import *
|
2024-03-19 21:08:24 +01:00
|
|
|
from QOLfunc import *
|
|
|
|
import pygame
|
|
|
|
|
|
|
|
|
2024-04-11 13:55:55 +02:00
|
|
|
def trashcanGenerator(mult) -> list:
|
2024-03-19 21:08:24 +01:00
|
|
|
typelist = ["paper", "metals_and_plastics", "mixed", "bio_waste", "glass"]
|
|
|
|
trash_cans = [
|
2024-03-25 11:21:23 +01:00
|
|
|
{'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'},
|
2024-03-19 21:08:24 +01:00
|
|
|
]
|
|
|
|
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:
|
2024-04-11 13:55:55 +02:00
|
|
|
trash_can_images[key] = pygame.transform.scale(trash_can_images[key], (mult, mult))
|
2024-03-19 21:08:24 +01:00
|
|
|
for i in range(5):
|
2024-04-11 13:55:55 +02:00
|
|
|
trashcan = generateTrashcan(mult, i, trash_can_images[typelist[i]], trash_cans[i]["position"],
|
|
|
|
trash_cans[i]["type"])
|
2024-03-19 21:08:24 +01:00
|
|
|
trashcans.append(trashcan)
|
|
|
|
|
|
|
|
return trashcans
|
|
|
|
|
|
|
|
|
2024-04-11 13:55:55 +02:00
|
|
|
def householdGenerator(mult):
|
|
|
|
new_house_size = (mult, mult)
|
2024-05-13 15:05:11 +02:00
|
|
|
temp = []
|
|
|
|
for i in range(1, 29):
|
|
|
|
if i % 2 == 1:
|
|
|
|
temp.append((i, 6))
|
|
|
|
temp.append((i, 12))
|
|
|
|
elif i % 2 == 0:
|
|
|
|
temp.append((i, 9))
|
|
|
|
if i % 2 == 1 and i % 4 != 1:
|
|
|
|
temp.append((i, 10))
|
|
|
|
house_positions = temp
|
2024-03-19 21:08:24 +01:00
|
|
|
houses = []
|
2024-05-13 15:05:11 +02:00
|
|
|
for i in range(len(house_positions)):
|
2024-03-25 14:26:41 +01:00
|
|
|
house_image = pygame.image.load(f'sprites/domek.png')
|
2024-03-19 21:08:24 +01:00
|
|
|
house_image = pygame.transform.scale(house_image, new_house_size)
|
2024-04-11 13:55:55 +02:00
|
|
|
house = generateHousehold(mult, i, house_image, house_positions[i])
|
2024-04-13 14:09:40 +02:00
|
|
|
if i == 1:
|
|
|
|
house.switchFinal()
|
2024-03-19 21:08:24 +01:00
|
|
|
houses.append(house)
|
|
|
|
|
|
|
|
return houses
|