From 486783b5eb9955c46eac3fed3477e890975d91e1 Mon Sep 17 00:00:00 2001 From: Woj Date: Mon, 27 Mar 2023 12:10:08 +0200 Subject: [PATCH] wozek has storage and wozek changes picture based on its load --- images/pelny_wozek_1_crate.png | Bin 0 -> 4283 bytes images/pelny_wozek_2_crates.png | Bin 0 -> 4367 bytes images/pelny_wozek_full_3_crates.png | Bin 0 -> 4437 bytes main.py | 30 ++++++++++++++++-- wozek.py | 44 +++++++++++++++++++++++++++ 5 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 images/pelny_wozek_1_crate.png create mode 100644 images/pelny_wozek_2_crates.png create mode 100644 images/pelny_wozek_full_3_crates.png create mode 100644 wozek.py diff --git a/images/pelny_wozek_1_crate.png b/images/pelny_wozek_1_crate.png new file mode 100644 index 0000000000000000000000000000000000000000..a55c1b14eb202e5bb9ea2884cb6652ebd39acd81 GIT binary patch literal 4283 zcmcIo_d6So^N-QmTUFDcMisSV6t&e>TDwXSZHxr9SCv+)R8(wQ#MX$A8bJuH-Iyh2 zL+f38)rc+m`u-80AMWnCUtV|jx_h2`?h>pX7;&%ySpfh5hl#PlqjOt%E-2=U=lW+| zTg$nj3w&gx2fz$oTRC?aA-Wd2008zQ+o{`ybDzcE*f9_Q;OzK+q3iLh@Bjd~txODb zZNgkO@>tSsNI5+;5_!)M*Q%pWlzM%=^MXM@T#R(Gf+5E?pm?6SACZIrF~}Cr=X7%4 zlD`6;H@GEhlJuInSCC&=I8l&?o3W$p8Xe+(N{#9s!G?T9hQdCk<-;3Q5dN$vf&YyafeIf7S=cXxPN9)lEECd z6gK~Iq}|Er72oJ>bf{WY=Q~(C8=IRQOdna%|J?Tdn5#C{zT|#q6_)D%J>ziT@4=G? zJ|bF_U9N}68wDaSm*!x}xf}P3$oq*(pBk0NF?oS0h$#Aa%f^2BD_-rYgS)c1Iy$p` z!t?q)&RjtoH#3jueqh1{y$Y^3bafS7dsyEpQi6~cAi?FFEc#%scK6u$o_zSddD|^u z+VDp{KSF@}W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AYE`+_Zo0y#uRqFW)sx%gf(nS@%(?q$1 z63wvBu;%8G<8Rq6i)d>L-9FHMl==?$`RXxK@wPYWvM-^YHMU?#@Ar3?_5zonJDkU> z{q%(x$VPe|<@641c6Z;O!L0J+Iulv_daGTXIXv6h9&)+98RNe<{wRI0c243j*q!R` zy6%C50i{0R+)ih<3eQOYZKr3Fl*fPdCoKtBN;c{fA55%rU6tto{9Ii&fR>i9!{{~t zr3Z5g9juLo(KTL?#bf;_q(>&Qa&2yFd!pFhd5>(=~x!qskPB5;6MN4jehT3QL zTwk2W9fJEpwF`3SYW=DTo;C?&WKja19RquChtIN(d}_3KB`MFHl}mi zHixquC3KJ&c^uj<(ZTJxjMt~XED~b8)z@4jEOcEbgpo)l^PYWqwJC||6SXp5Dr4}g zPYXqvQ2Ca}C6R(DwSwfc={k$}snWH5pD@C25gYb3zHQTj)qw$>&<2%*Q{;Z_fIwWP zIsBf}LPP7#zwDj`e_0THLvO-2m*kzO^t;p2ahP>yVsO~0Y=aD G_5T45?omeo literal 0 HcmV?d00001 diff --git a/images/pelny_wozek_2_crates.png b/images/pelny_wozek_2_crates.png new file mode 100644 index 0000000000000000000000000000000000000000..6cb71039863fb889cf1536fe614c970d2b3b6a6c GIT binary patch literal 4367 zcmcIo^-~mp5zuDQD-I;G^XLdJ6Uss)qoP`_!08nXas2bjK`7My7#J3h(+unLh z1YU;fDuBwtdmFb7p|dhn834c}P+Zy(-TGu68s=UA0I2i7An1jcz61bhiZoS~js0!5 zbI4MS$LpeQHUo-Cnm5u%h_^UFoQVR2FZ+xf#+Vps?(*!VzhpMYC^a{V97AV&!IK}@z6Cwjf{RlK0Gsz#QXsB7Qwv}IbsH8)n*f7Xk4KmXO< zwnJO|CvYrGS03|*b?=wGj9bHZBSX7tq^fIGUY0PHpL@bARAyi3vi=2Pz(udCBxGOg z7dn7aQ~t)za||X*yDe#2G_H!m_~MeoQX5lbJh4vanwo@dzWG5TcN7jZL0}HKYvM1K z0+`RVJ=A$?+0u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i=> zdU#XD!f9ASeQr>qAS$c<)Ez+}%W@6*@Tbk6!eYEQB~5w9n7{hzHWbC$}F_V z@-Glj`a$#$$DJm%4^mO|6S?D>!w5fI#zQd}tr?kmKvl-u#hDMfj~RwaY~F<;eB5Af z%FK10rk4yqn*kP-HM&|M{h*V-!V_drHmtz^KNR>cX-JqQJrCKZ7gx{I#!}owAw-(0 Ly3ebWZNmNs8uE^B literal 0 HcmV?d00001 diff --git a/main.py b/main.py index 3b9df7f..6296b94 100644 --- a/main.py +++ b/main.py @@ -2,6 +2,7 @@ import sys import pygame import regal import paczka +#from wozek import Wozek pygame.init() screen = pygame.display.set_mode((980, 980)) @@ -11,7 +12,7 @@ pygame.display.set_caption("Inteligentny wozek") icon = pygame.image.load('images/icon.png') pygame.display.set_icon(icon) -class Wozek: +class Wozek(): def __init__(self): self.x = 55 self.y = 55 @@ -26,9 +27,34 @@ class Wozek: def draw(self): screen.blit(self.image, (self.x, self.y)) + #storage = ["none"] * 10 + storage = [] + max_size = 10 + + def add_element(element, storage, max_size): + if len(storage) < max_size: + storage.append(element) + else: + print("I'm full!") + def remove_element(storage): + if len(storage) > 0: + place = storage.pop() + return place + else: + print("I'm empty!") + + def dynamic_wozek_picture(wozek, storage): + if len(storage) == 0: + wozek.image = pygame.image.load("images/pusty_wozek.png") + elif ((len(storage) > 0) and (len(storage) < 4)): + wozek.image = pygame.image.load("images/pelny_wozek_1_crate.png") + elif ((len(storage) > 3) and (len(storage) < 10)): + wozek.image = pygame.image.load("images/pelny_wozek_2_crates.png") + elif (len(storage) == 10): + wozek.image = pygame.image.load("images/pelny_wozek_full_3_crates.png") + def main(): - wozek = Wozek() while True: for event in pygame.event.get(): diff --git a/wozek.py b/wozek.py new file mode 100644 index 0000000..cc083f8 --- /dev/null +++ b/wozek.py @@ -0,0 +1,44 @@ +from main import pygame, screen + +#screen nie dziaƂa + +class Wozek(): + def __init__(self): + self.x = 55 + self.y = 55 + self.x_change = 0 + self.y_change = 0 + self.height = 64 + self.width = 64 + self.image = pygame.image.load("images/pusty_wozek.png") + # Credit: Forklift icons created by Smashicons - Flaticon + # https://www.flaticon.com/free-icons/forklift + + def draw(self): + screen.blit(self.image, (self.x, self.y)) + + #storage = ["none"] * 10 + storage = [] + max_size = 10 + + def add_element(element, storage, max_size): + if len(storage) < max_size: + storage.append(element) + else: + print("I'm full!") + def remove_element(storage): + if len(storage) > 0: + place = storage.pop() + return place + else: + print("I'm empty!") + + def dynamic_wozek_picture(wozek, storage): + if len(storage) == 0: + wozek.image = pygame.image.load("images/pusty_wozek.png") + elif ((len(storage) > 0) and (len(storage) < 4)): + wozek.image = pygame.image.load("images/pelny_wozek_1_crate.png") + elif ((len(storage) > 3) and (len(storage) < 10)): + wozek.image = pygame.image.load("images/pelny_wozek_2_crates.png") + elif (len(storage) == 10): + wozek.image = pygame.image.load("images/pelny_wozek_full_3_crates.png") \ No newline at end of file