From 133e54ab12775ead11b677988bbe115faf0d54d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zuzanna=20W=C3=B3jcik?= Date: Fri, 2 Jun 2023 21:14:55 +0200 Subject: [PATCH] added letters --- ekran.py | 30 ++++++++++----- images/letter.png | Bin 0 -> 1356 bytes packageList.py => itemList.py | 10 ++--- letter.py | 23 +++++++++++ main.py | 70 +++++++++++++++++++++------------- wozek.py | 30 +++++++++++---- 6 files changed, 114 insertions(+), 49 deletions(-) create mode 100644 images/letter.png rename packageList.py => itemList.py (69%) create mode 100644 letter.py diff --git a/ekran.py b/ekran.py index 2f58e07..58ec201 100644 --- a/ekran.py +++ b/ekran.py @@ -1,7 +1,7 @@ import pygame import plansza from regal import Regal -from packageList import * +from itemList import * EKRAN_SZEROKOSC = 770 EKRAN_WYSOKOSC = 770 @@ -14,8 +14,9 @@ pygame.display.set_caption("Inteligentny wozek") icon = pygame.image.load('images/icon.png') pygame.display.set_icon(icon) -lista_paczek = [] +lista_itemow = [] lista_paczek_na_regalach = [] +lista_listow_w_skrzynce = [] def narysuj_regaly(): global lista_regalow @@ -62,7 +63,7 @@ def odswiez_ekran(wozek): screen.blit(miejsce,(plansza.a_pix, plansza.b_pix)) screen.blit(skrzynka,(plansza.c_pix, plansza.d_pix)) narysuj_siatke() - narysuj_paczki(wozek) + narysuj_items() narysuj_paczke_na_regale() narysuj_regaly() wozek.draw() @@ -85,17 +86,26 @@ def sprawdz_ktora_kolumna(y): nr_kolumny = nr_kolumny + 1 -def narysuj_paczki(wozek): - for paczka in lista_paczek: - paczka.narysuj(paczka.x, paczka.y, screen) +def narysuj_items(): + for item in lista_itemow: + item.narysuj(item.x, item.y, screen) def narysuj_paczke_na_regale(): for paczka in lista_paczek_na_regalach: if paczka.is_in_move is False: paczka.narysuj(paczka.x, paczka.y, screen) -def dodaj_paczki_na_rampe(p1, p2): - lista_paczek.append(p1) - lista_paczek.append(p2) +def narysuj_list_na_skrzynce(): + for letter in lista_listow_w_skrzynce: + if letter.is_in_move is False: + letter.narysuj(letter.x, letter.y, screen) + +def dodaj_na_rampe(p1, p2, l1, l2): + lista_itemow.append(p1) + lista_itemow.append(p2) + lista_itemow.append(l1) + lista_itemow.append(l2) p1.update_position(plansza.a_pix, plansza.b_pix) - p2.update_position(plansza.a_pix, plansza.b_pix) \ No newline at end of file + p2.update_position(plansza.a_pix, plansza.b_pix) + l1.update_position(plansza.a_pix, plansza.b_pix) + l2.update_position(plansza.a_pix, plansza.b_pix) \ No newline at end of file diff --git a/images/letter.png b/images/letter.png new file mode 100644 index 0000000000000000000000000000000000000000..0f174492ab4bb28cd3467c27013e4c038acbe396 GIT binary patch literal 1356 zcmV-S1+)5zP)HMT*#zjN6 z!R8{%5;Yi>xEW1M91w~464xYm=^#A;OQsRF^PiC^Mn>foU5J8v>zjbGyAvf46q+yn5z!IO ze0-VG_dAHOiX_CEa7@XF02|CE8mn`Om7*!B{vP{>m-L=hbE@h(dA+6`$s+LesT3^H z?(aL%v*6JOws4_3hgd0^H*0=~s0dYcofKDHM6!r9p0=@fm$Yz9T)Hq4BP_~Cap9dz zFL}5n07O=VrSc7x`+5Aqc%L;s0U$CW_{cw;vh2EL1Hk%@;IBNa5&+g`1U2$-n*gxB zBB+%IKLWt|h!BW8_!$7gJ3^rHpdtW-XM|wnL1h34uL!})LjVCFJR)cz4*>=MeIsZk z4?zR~eIjTn4?zZiwT+;)JZKOA)+RzIU0 z6*b{-x;TCyZsGB)Oe;+lHe#&q2<5eHD2lS;>nMssd2JiTRTqh|ihT2~_XW)3`{Qsp zT^uTE(kw#I0Xlj{c&exwhtowxK@x>|30}wd?6lHsw-G0al-0I!;N{Qg>h&G|mn%c; zd+AfkYFmkuM4Ih3_UyEJttre)pz=gA4yTLUlTEaC4F)?t0-$W)8q4orKBxN09X%r) zJlVvgbB>CFB;I&-^NMSG|C}Z7)F6EWvjC)SjpzQfBosxV@7fIpMkWAAPc`$!+bN`{ znpb?Ss?Tpyd~Q_rnZY#m8=`9zfVBLp^k1J_{B2MzYUBYjwwvks;2zF@J5Jqq6a3US z!C%AU?!iQXM>4DwWXEwVJD%vM)qkWdI+6%L@wrhB7qsFh!if2U;zZ@5qZ zTT&DoE$TmwYInkNJ3#fjY9SA>(IRrM&CGo^b3pRo-U*c_l5tMEI9%Kk(078Wch*W? zOM;EycYtt|_Yh13zXF7_yoW#|+%~{^koOQsgjEA9mA4-YZ+QFn{Z6aT<&#W zTU@vvaBXCcqZLEC&9){eQGm$2ym(p8xLuw*{0|d)4`E