Merge remote-tracking branch 'origin/master'

This commit is contained in:
s464931 2022-05-18 01:11:08 +02:00
commit 86d4793cd7
4 changed files with 19 additions and 6 deletions

View File

@ -44,8 +44,8 @@ ZawartoscPolaNaKolorPola = {
ZawartoscPola.PUSTE: BIALY,
ZawartoscPola.SCIANA: CIEMNY_BRAZOWY1,
ZawartoscPola.CEL: ZIELONY1,
ZawartoscPola.DYWAN: ZOLTY1,
ZawartoscPola.KALUZA: NIEBIESKI1,
ZawartoscPola.DYWAN: DYWAN,
ZawartoscPola.KALUZA: KALUZA,
ZawartoscPola.SCIANA2: SZARY1,
ZawartoscPola.OSOBA: IKONA
}

View File

@ -71,12 +71,21 @@ class Krata(Obserwowany):
start = (self.odstepMiedzyPolami + self.bokPola) * kolumna + self.odstepMiedzyPolami
gora = (self.odstepMiedzyPolami + self.bokPola) * wiersz + self.odstepMiedzyPolami
kolor_pola = ZawartoscPolaNaKolorPola[self.krata[wiersz][kolumna]]
if kolor_pola != IKONA:
pygame.draw.rect(self.okno, kolor_pola, [start, gora, self.bokPola, self.bokPola])
else:
if kolor_pola == IKONA:
osoba_ikona = pygame.transform.scale(pygame.image.load(os.path.join('Ikony', 'osoba2.png')),
(BOK_AGENTA1, BOK_AGENTA1))
self.okno.blit(osoba_ikona, [start, gora, self.bokPola, self.bokPola])
elif kolor_pola == KALUZA:
osoba_ikona = pygame.transform.scale(pygame.image.load(os.path.join('Ikony', 'kaluza.png')),
(BOK_AGENTA1, BOK_AGENTA1))
self.okno.blit(osoba_ikona, [start, gora, self.bokPola, self.bokPola])
elif kolor_pola == DYWAN:
osoba_ikona = pygame.transform.scale(pygame.image.load(os.path.join('Ikony', 'dywan.png')),
(BOK_AGENTA1, BOK_AGENTA1))
self.okno.blit(osoba_ikona, [start, gora, self.bokPola, self.bokPola])
else:
pygame.draw.rect(self.okno, kolor_pola, [start, gora, self.bokPola, self.bokPola])
def narysujKrateAlternatywnie(self):
self.okno.fill(SZARY1)

View File

@ -23,7 +23,7 @@ def dodaj_agenta():
# random.randint(0, LICZBA_POL_W_POZIOMIE - BOK_AGENTA1_W_POLACH))
# pole_lewe_gorne = PoleKraty(krata_magazynu, LICZBA_POL_W_PIONIE - BOK_AGENTA1_W_POLACH, int(LICZBA_POL_W_POZIOMIE / 2))
pole_lewe_gorne = PoleKraty(krata_magazynu, 0, 0)
pom = 'test2_ikona.png'
pom = 'wozek_widlowy.png'
ikona = pygame.transform.scale(pygame.image.load(os.path.join('Ikony', pom)),
(BOK_AGENTA1, BOK_AGENTA1))
Agent(krata_magazynu, pole_lewe_gorne, ikona)

View File

@ -28,6 +28,10 @@ ZOLTY1 = (231, 213, 69)
NIEBIESKI1 = (65, 125, 225)
IKONA=pygame.transform.scale(pygame.image.load(os.path.join('Ikony', 'osoba2.png')),
(BOK_AGENTA1, BOK_AGENTA1))
KALUZA=pygame.transform.scale(pygame.image.load(os.path.join('Ikony', 'kaluza.png')),
(BOK_AGENTA1, BOK_AGENTA1))
DYWAN=pygame.transform.scale(pygame.image.load(os.path.join('Ikony', 'dywan.png')),
(BOK_AGENTA1, BOK_AGENTA1))
###
###