From b369c5d21c514fe775c26e5ec3d60e8e361cc98f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zuzanna=20W=C3=B3jcik?= Date: Sun, 26 Mar 2023 21:21:52 +0200 Subject: [PATCH] movement and graphics changed --- __pycache__/main.cpython-310.pyc | Bin 0 -> 2120 bytes __pycache__/regal.cpython-310.pyc | Bin 0 -> 1627 bytes images/icon.png | Bin 0 -> 1642 bytes paczka_obrazek.png => images/paczka.png | Bin wozek.png => images/pelny_wozek.png | Bin images/pusty_wozek.png | Bin 0 -> 3609 bytes images/regal.png | Bin 0 -> 1061 bytes images/regal1.png | Bin 0 -> 964 bytes images/regal2.png | Bin 0 -> 957 bytes images/regal3.png | Bin 0 -> 957 bytes main.py | 82 ++++++++++++++++-------- paczka.py | 2 +- regal.py | 24 +++++-- 13 files changed, 75 insertions(+), 33 deletions(-) create mode 100644 __pycache__/main.cpython-310.pyc create mode 100644 __pycache__/regal.cpython-310.pyc create mode 100644 images/icon.png rename paczka_obrazek.png => images/paczka.png (100%) rename wozek.png => images/pelny_wozek.png (100%) create mode 100644 images/pusty_wozek.png create mode 100644 images/regal.png create mode 100644 images/regal1.png create mode 100644 images/regal2.png create mode 100644 images/regal3.png diff --git a/__pycache__/main.cpython-310.pyc b/__pycache__/main.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0a7d4f02f752ed7070ccd3608ca4bff6742139bd GIT binary patch literal 2120 zcmZuy&2Aev5GJYJ)#_iC9mh?3$gL1sqy-8jK%2HMV&?}gTsyH5RB*9SMOt22Udh~b zZ3zxgz`6HQpg>RZt$B?;Lr=W+v~N)Kl72(U)&?~f9L_g09FoJ~?4VL9GPHkwzbii~ zG4?lsY|8p{iWKr{pheZx&PRfNeHK`WH5(1;DuR zEJ{>A?5ZeUL;aw$aR0^!Ni1#poCA0~t0UN)N3 z_1_iQVC)^WLj)Gv34$;RlOU+TYg`5K`21_|an;)2yE6M<6kSZQQM>~tVH3orhxqjn zx1O^vE(LC%BE>hGuJPiIRw^>ikNq&ww50ZkL12nOa5Ru7ed5bOaD3A4Pc?dxTrLxtJGUIIpeYN==rL`?XFe~NtgHig z-Dq*r+k-|x3AZh-eR5c zb7Hl%k@efy)*X*O20n>tF1QM&w(Gd+6%lq>KI1+(m0Ku@;LN zi$A6o$MTr5eq;Un zweMbTn%tp6S=k8IUp)F|Yu$Jo0f{v&Yn+W>cMGP$^Jh<8GO6`c*nSKu)CG1 z2TOLwe%S9DSF3It!*d$!TQ+$a#>0MlWSsqeIBW_OPpb0zW6a7t^l25LYDYne4?sL2 zc$JrVk*}baMHvO}oi0`&p)P)|i#jg~A9f!4Y|Pc2I=3IRH;uk13h}32#bQ*UX!Rgy z*7TwNjQk6Ws)uj6Yx7UJ}HTtUeGEu`Zkdp i%A4^YPOIWqlsPfgXsU7eaBMnynOB8h_t%QtdHWxD1>Da7 literal 0 HcmV?d00001 diff --git a/__pycache__/regal.cpython-310.pyc b/__pycache__/regal.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d394c2a5273cf8b852cf5a31f7a7b4b86023f71a GIT binary patch literal 1627 zcmaJ?&ubew6qYnUJa%j+4QZMd3O(#$4JEtV!X8Qqfen<>#e{|u7y^TKqZd&bqKV{-;cz*fRK+k zS!@nWcA@KE!3ZK~MnW7}M#n5APO4LThgmaJJTu>Nk6W2k-0NWkb2v!R; z`(WOaffM?tvvI<{&^8UJ9?v~(nsNR&hwlf?Ma=M#pLK^Udk*P z$-K;G(P=T4>CMog4JkR|+4f{+9u|LONj%@T3k>;wA#}-46ZuNe8V3 z{pUKW4WU~EAPJU$-@#cV-~=i70gmoeN=q6)*}n zHehB`WYbZh{poUb^utZj49y-0*^N zZfOib6sVI3$OKC(29{MWSf_L==NzLRc&_#QvQ-i51wb>XJN49#^&B94r)*z#V1_w5 zVpsIcE88b4mtEmnzjxWMJjh}9kJ%Me1$abwfWock0}5Y?()un+04Nt0r41+-OHn%C zMOguq_ZFoKC?A%h^p>FrasYMT^g(}E?*i4zmYxgVd@ULCk<>q37e_v-@h)l<#{AA= z?w9QeB(VtU?yck#n?$wLYqye5F*#T@D^{S5u)_Z7Oc&`F87st82w>|BJ_HFA`aEo< zR?pljE^J-v*!Yv#h>xXd9Zc0RkEQYKR*jn#TqqQxaiPY`fv>QV)qOO$MA%fxp+)C* zLF2&LzpaTNijq7jqi7Re(m#XoY4hu_4(-qlwobcrW621W^6$KFPrCgXXb9>D)Eu@Q zMWz!)<3da`^t(~?cFMCRqaMLp3%jwOKfDcv#NLIj@!kT`r8WX5d;oLfj(L*XlUo8U bU-p6j!!p71X7wEug2sOm0Av9Rg7x4NP&ak% literal 0 HcmV?d00001 diff --git a/images/icon.png b/images/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..4046b9a184c7e1447d9e35e3546192837e2785c8 GIT binary patch literal 1642 zcmV-w29^1VP)MQQ#~;R`E85>knmS!jZbt30-4U$=92S=~Xz zPiXpPezV`b``vqf_nzN5_gpZ>-~l}`Qi;S$zf1`9O8lXaVhg>?z2|ulpbvqxi16Xv z?LUGE!Qt&_NgRWlIt9L?v6BCSz!Zr@Y?sSKPKg*!sRYgdUv%|{KtFUnJrlOe2hf-l zjc%zJTZc@bm&77}fB%2BzcZ^|E`yWWI?oa2&5+`CwEnS zna~g#gzf1d{8ai)e#>bzqzjNf-x@}EFl(^_niO;BEvm3`S`_8jc#gB9}{Auu*DFtCHQYxZ{ zG@8A+xw+OepNbti6}o7msCyWe81yLgk)tO#0A;+72p459Mf<8$^iXK75lny{l|&+0 z;j33~)#-HgggMQZ{u1O_D_t1x#>8VNaQ-0bcC#wskl+N z5|&{)d@h)P!C)v!Oq^_5ks%}IB4_Q{L)9aK;CvyS{=W=1FBKN46dODPNNii;V_|MR z3q}MT^dH|T31J$IyLB=LjX}CQkwA~37vg>is8p&Orz`hWb7P#q?p+@=dlT5038qq^ z*fT(@M(rD~fQ<-&o!%XB(dZ%)Yso;guMXXfc{rnxxl=gb70=O4F3s(ifL5#B9UD8= z^l+rqRR<)*hni^n+2RFm0@+z$Y9&g%R+OSv;Szmw?e!O7uQ>wd-l5>!I@kSl}?2`O3}vanwf!zMG>25#W9|8jS-I@LZ?Ljt)Po>1QK84A1 zN(HRNA5uutTm`S;!f-!ya7_pzKqZ({DwQ$`m0vvjafn4cBJQ-kK|-_jEzd}#*51s? za+aYv`XN_wl0nE{zeKwhF5qv&~S z8Lp;HMCbaID4jh66#_&kb_l%(3>sy zs1Xze+y(4PWD5_qmY-?ByI{7ayTh)Ae- z!d+l*Yin~6n4juC-AF)OP;77Bz{W#ET+zZKi0QO+TRP|NpPh`JtR-leGYc*2C<@L~ zHhqG0ku)A19FLDjXL2kYJaa;?*B{Ev%(RykMqTB`Paf!C7wow>;1s!uR}+OAF92@AR+?S zw{HeJ_bn``F)ag}dCVyr=NHy%izZ7g(6l+^0&zUH||9 literal 0 HcmV?d00001 diff --git a/paczka_obrazek.png b/images/paczka.png similarity index 100% rename from paczka_obrazek.png rename to images/paczka.png diff --git a/wozek.png b/images/pelny_wozek.png similarity index 100% rename from wozek.png rename to images/pelny_wozek.png diff --git a/images/pusty_wozek.png b/images/pusty_wozek.png new file mode 100644 index 0000000000000000000000000000000000000000..463e7d0a0fd55c04a057459ae746a7516ea295f5 GIT binary patch literal 3609 zcmZ{nXHe5!(}({lQbj`-LX|2t(glPdQF<2z0}{GOZvvs1TS1y|qd|&N6hQ=}OGIi! zkWPs7Vn75$LJ3F@<>meI%sd~So!Rr7vuCf_FXx=uO|&#OU}NED0RVu_$Pi_Hs>uI$ z81!_tq`C8)iioSBwHW|lB>?~z3jhbFA>0xGgdzZ783O>CSpdKrkkeqLeR=?PF)=^^ zKxvAY(&>&lz|cPUR8O-`o#uUw1OR90Mku|T;gch1ubVGM_+wg>5fNz+!vdU(%q*K} zFjA?B(B9*a9P0nb-i4rax!>VgVXsO_#Sib#eeUL75ktw&So#~v2*&VzR#uOa$Yqfm zFCv7_=lpEey{kTR1&qZ(#%o7AX{*sYw3X(WBXh=jsl3Q@_q-tq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co1-eOVIKV-v+|{h literal 0 HcmV?d00001 diff --git a/images/regal.png b/images/regal.png new file mode 100644 index 0000000000000000000000000000000000000000..83a3e9ab9ab6d31a3d1f49144f94a5f88da284c0 GIT binary patch literal 1061 zcmV+=1ls$FP)^P10_3!vJ*jGMZ&A1Fp*3{Ea-VW6tAOS49+t;@ta1my%0w?K z6TO!Dlw(;1R4QHq+z!BPyac!%fZKQpa616E@e-h76Z5{Rkb8jGKXgg#=n9wedRi8( zqpL^kAG)0R9hFbE>X(4#yFj4+Gyvhg0m6L)js#>C$@O<6*WVGSKZU5Vnl%%!yYoBG zStYW&vyDG+s^IaeUjmv5$SeV13Gh`|TRNCS;j>>f0o8z+1Y8Hwl))`d*3!VR(aD%e zKtE7hw3qYL0)}r@rX{iHSeQjgwKc-xqa;g@l1xp{GBq;?NTO#vX3FP&D#g;nBoCf_ zH5?0As0r%j^S3=fsU8DteBX0A9Oo~B;Wj@$pVID=jya9v6|gYU&B92x(|=nK?>4An z6LUU~JYEI39e~?-32-}ra%2Gz`v)(H?VU$J66*|`m&9snRGwHW3}20Qk!wB(Wt5ak zmc;yldh?Rl&h`Q7RV?q%sw*&zB`v4XD4NH}(KH8TUyzJSl!(U& zHJ-`t7qm(}D)>4q7JeVLQWPyJWOkibSBVPQjbf=NDi=Hx@feAiRG4SuHfm0*r^vwFM@WLs~uQc0d|+G9hBv5&`G=mxE+AoRDA-} zxC@9E1}}P&ST*PY+LBoPQINz+*d^vkVpXsNs$LRP;|a>E=?lYN+~)<#c|4bQQmcRs fowjmkQ;+RG>;^IbYXPeR00000NkvXXu0mjfSbolN literal 0 HcmV?d00001 diff --git a/images/regal1.png b/images/regal1.png new file mode 100644 index 0000000000000000000000000000000000000000..e099f544d767ad45154b220900d38d86e5a3c34d GIT binary patch literal 964 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!6p}rHd>I(3)EF2VS{N990fib~ zFff!FFfhDIU|_JC!N4G1FlSew4N&5CfKP}kkfte+kdl>@mXnZ@(KoWtH@46-GB+}_ zF*diU*DCrS^0c_5?Agn=FI>-ONXHhJmPg42M#}|8$pzGC7Sw4LR%_%LnOUo-YpJMf zYv~z>#H2;Y`bWwJG-;PGGB7r4ml>H_E30X#sA;KcXsc@IWJ<>xnp!nzmt;xDsj6#B z&N}iL=r{S2AirRSyl45j-ah|4w`|?ExuetTdwoNl-!I?VpEZpOmMy8uWvL>2?-1Tg-P?Q|Z(5bYto_mT zb2aycFAb8iXD2cI(*3c!H11D6+lG8a)(7v+j6wK-?ObM~hA24;Aikiy!X;{&G7swm z_rDxk6U!VgTe~DWM4f0H8OH literal 0 HcmV?d00001 diff --git a/images/regal2.png b/images/regal2.png new file mode 100644 index 0000000000000000000000000000000000000000..23c2a55d7de902c977b772fc576c390eab8e84c8 GIT binary patch literal 957 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!6p}rHd>I(3)EF2VS{N990fib~ zFff!FFfhDIU|_JC!N4G1FlSew4N&50fKP}kkfte+kdl>@mXnZ@(KoWtH@46-GB+}_ zF*dhROel9c_^!C5?Agn=7HhAI`6d*XmW#WDh`WX=#FZ$-mny^-8<|NV1~SB`MKUc|2(&B-L|=-)9ZVEL!I9*-`bxwjSH47smf+PWd>BrnB?v5!qCAg z>jC6&7I;J!1L*`X{*di-9>`!X@$_|Nf6go=%w;xZiB30APot-cV@Sl|x7V`6n+zn_ zKX~4}ds|3nvz)fD!RFPHkvEV2`X|3K_dpZlp&4@@bI&v1@O;DlZOVW8IWB5tMsa#x zowaQ3|K3v$t8|R(n|*HFd2~4UMOmUd+l|)C#y1`x=9=?;L07<9zK5%>Kbn>DRO^f0 zf8xP>GREsUGiMtJ~>~=@$?3*Xacs%yvNnRWOmw#S*=P9iF$DVO8n^A|cV)EZP=}aH=xNBVc z76@f(7qLur@nURQU}ccPXt-j7O~THXCQ9aq&$BiN@`mnx$=E0ExAA~tjq0DPtQpk@ z=JYzvHL792(!%7V~}*v<>y#1jr|RW*2HPgIg%NF1ll)w zEs+h}q|99Mq9@tT=3|pq_12d?VtaqH{(3ess!yyr7Z^XPC9V-ADTyViR>?)FK#IZ0 zz{ptFz*yJFEX2^#%Fw{d)I{6Bz{I(3)EF2VS{N990fib~ zFff!FFfhDIU|_JC!N4G1FlSew4N&50fKP}kkfte+kdl>@mXnZ@(KoWtH@46-GB+}_ zF*dgm$W>Il4+_Uz?bx#PCHQPRbw<=npFJbn@aS&9PLiUOI6MrPJ3>RKx5+FE+X zAu(y(KH`G;N(_t)f(1%Orq;@8S}JN$v}er zgXhh=w}o^z%V`T6Y+fxHdGqM6fATAH4>U0znlbk=_dN3r&o|uPru?U$*(PO2@dq+2_WcM~8D?lqI^e-DtgReB<$9t~uWqbOo&Cd${WQqgg3WwZ7;r zIMm4Y#rMD$t+1TUjRI_&{nrZ~*pz#_>EP3bd%WwL&I;x)W4xX-bGCs%&N9aBZ*J~3 zD3H%s#<-`+VM8PXs{sF-!_7tpY$vN?%n}Yg@m!>)UCE*&yo%F)vC)Mqn{(pKg&60& z{ZYXvQ1vpxZg-^4zIl?2$73&^=_5M8Fd&dCjXt2&h$Z#yT+w& zfl#J)5zAB;FUFPyRt71IhATGMBZ|L5ajD6yM8xJVfsQ$Uino)gV zPVci!hTmd;?oJZ_Kb!ea^a+L^yU+51Fv~nW21y59evSpx*xztyO`P_eBbo6>pna3q z64}5_%FHD%dXnvIJ~nApZ++P#w)Z#duV)jZ`ox-Zf$^hS;u=wsl30>zm0Xkxq!^40 zjEr>+jCGC7LJTdf3=OS}&9w~-tPBkD9$qp<(U6;;l9^VCTZ8= 100: - wozek.y -= 80 - elif event.type == pygame.KEYDOWN and event.key == pygame.K_RIGHT: - if wozek.x <= 800: - wozek.x += 80 - elif event.type == pygame.KEYDOWN and event.key == pygame.K_LEFT: - if wozek.x >= 100: - wozek.x -= 80 + if event.type == pygame.KEYDOWN: + if event.key == pygame.K_DOWN: + wozek.y_change = 1 + if event.key == pygame.K_UP: + wozek.y_change = -1 + if event.key == pygame.K_RIGHT: + wozek.x_change = 1 + if event.key == pygame.K_LEFT: + wozek.x_change = -1 + + if event.type == pygame.KEYUP: + if event.key == pygame.K_DOWN or event.key == pygame.K_UP: + wozek.y_change = 0 + if event.key == pygame.K_RIGHT or event.key == pygame.K_LEFT: + wozek.x_change = 0 + + wozek.x += wozek.x_change + wozek.y += wozek.y_change + + if wozek.x <= 0: + wozek.x = 0 + elif wozek.x >= 916: + wozek.x = 916 + if wozek.y <= 0: + wozek.y = 0 + elif wozek.x >= 916: + wozek.x = 916 # Drawing - screen.fill((0, 0, 0)) # removes object trail + screen.fill((51,51,51)) # removes object trail # idRegału, Długość regału podana w kratkach, Współrzędne od których ma być tworzony regał (wiersz,kolumna) - poziomo # Współrzędne od (1,1) do (10,10) - regal1 = regal.Regal(1, 5, 1, 1) - regal.Regal(2, 10, 2, 3) - regal.Regal(3, 2, 3, 7) - regal.Regal(4, 1, 10, 10) + regal.Regal(1, 1, 2, 2) + regal.Regal(2, 1, 2, 3) + regal.Regal(3, 1, 3, 2) + regal.Regal(4, 1, 3, 3) + + regal.Regal(5, 1, 8, 2) + regal.Regal(6, 1, 8, 3) + regal.Regal(7, 1, 9, 2) + regal.Regal(8, 1, 9, 3) + + regal.Regal(9, 1, 2, 8) + regal.Regal(10, 1, 2, 9) + regal.Regal(11, 1, 3, 8) + regal.Regal(12, 1, 3, 9) + + regal.Regal(13, 1, 8, 8) + regal.Regal(14, 1, 8, 9) + regal.Regal(15, 1, 9, 8) + regal.Regal(16, 1, 9, 9) - draw_grid() wozek.draw() pygame.display.flip() # updating frames diff --git a/paczka.py b/paczka.py index c952b95..7a6aec7 100644 --- a/paczka.py +++ b/paczka.py @@ -12,7 +12,7 @@ class Paczka: self.y = 0 self.szerokosc = 0 self.wysokosc = 0 - self.image = pygame.image.load("paczka_obrazek.png") + self.image = pygame.image.load("images/paczka_obrazek.png") # zmienia rozmiar obrazka w zaleznosci od rozmiaru def __dobierz_rozmiar_obrazka(self): diff --git a/regal.py b/regal.py index 428fd07..6d26ad4 100644 --- a/regal.py +++ b/regal.py @@ -21,7 +21,7 @@ def obliczPixeleDlugosciRegalu(self): #Przeliczanie dlugości regału podanego class Regal: def __init__(self, numerRegalu, dlugoscRegaluWKratkach, numerWiersza, numerKolumny): self.numerRegalu = numerRegalu - self.wysokoscRegalu = 40 + self.wysokoscRegalu = 64 self.dlugoscRegaluWKratkach = dlugoscRegaluWKratkach self.numerKolumny = numerKolumny @@ -29,7 +29,23 @@ class Regal: self.kolumna = obliczPixeleNaPodstawieKratek(numerKolumny) self.dlugosc = obliczPixeleDlugosciRegalu(self) - reg = pygame.Surface([self.dlugosc, self.wysokoscRegalu]) - reg.fill((255, 0, 0)) - screen.blit(reg, (self.wiersz, self.kolumna)) + if(self.numerRegalu >= 0 and self.numerRegalu <= 4): + reg = pygame.Surface([self.dlugosc, self.wysokoscRegalu]) + reg = pygame.image.load("images/regal.png") + screen.blit(reg, (self.wiersz, self.kolumna)) + + if(self.numerRegalu >= 5 and self.numerRegalu <= 8): + reg = pygame.Surface([self.dlugosc, self.wysokoscRegalu]) + reg = pygame.image.load("images/regal1.png") + screen.blit(reg, (self.wiersz, self.kolumna)) + + if(self.numerRegalu >= 9 and self.numerRegalu <= 12): + reg = pygame.Surface([self.dlugosc, self.wysokoscRegalu]) + reg = pygame.image.load("images/regal2.png") + screen.blit(reg, (self.wiersz, self.kolumna)) + + if(self.numerRegalu >= 13 and self.numerRegalu <= 16): + reg = pygame.Surface([self.dlugosc, self.wysokoscRegalu]) + reg = pygame.image.load("images/regal3.png") + screen.blit(reg, (self.wiersz, self.kolumna))