Update 'startup.py'

This commit is contained in:
Maksymilian Szygenda 2023-04-23 15:37:22 +02:00
parent 9f7ca5d0ed
commit 2fbf2be1d7

View File

@ -5,6 +5,8 @@ import pygame
from typing import Tuple, List from typing import Tuple, List
from street import Street, StreetType from street import Street, StreetType
from garbageTruck import GarbageTruck from garbageTruck import GarbageTruck
from garbageCan import GarbageCan
def startup(game_context: GameContext): def startup(game_context: GameContext):
render_background(game_context) render_background(game_context)
@ -23,10 +25,13 @@ def render_background(game_context: GameContext):
game_context.canvas.blit(pygame_bg_image, (0, 0)) game_context.canvas.blit(pygame_bg_image, (0, 0))
def create_city() -> City: def create_city() -> City:
city: City = City() city: City = City()
streets = create_streets() streets = create_streets()
trashcans = create_trashcans()
for s in streets: for s in streets:
city.add_street(s) city.add_street(s)
for t in trashcans:
city.add_node(t)
return city return city
def create_streets() -> List[Street]: def create_streets() -> List[Street]:
@ -41,4 +46,15 @@ def create_streets() -> List[Street]:
streets.append(Street(3, 25, 23, StreetType.HORIZONTAL)) streets.append(Street(3, 25, 23, StreetType.HORIZONTAL))
streets.append(Street(17, 30, 13, StreetType.VERTICAL)) streets.append(Street(17, 30, 13, StreetType.VERTICAL))
streets.append(Street(17, 23, 25, StreetType.VERTICAL)) streets.append(Street(17, 23, 25, StreetType.VERTICAL))
return streets return streets
def create_trashcans() -> List[GarbageCan]:
trashcans = []
trashcans.append(GarbageCan((9, 4)))
trashcans.append(GarbageCan((9, 15)))
trashcans.append(GarbageCan((12, 22)))
trashcans.append(GarbageCan((3, 24)))
trashcans.append(GarbageCan((17, 9)))
trashcans.append(GarbageCan((24, 17)))
trashcans.append(GarbageCan((26, 4)))
return trashcans