From 2c8eba52e0783ff63cc4cc2f494f7b0c870502db Mon Sep 17 00:00:00 2001 From: Megamichi Date: Sun, 21 Jan 2024 16:11:52 +0100 Subject: [PATCH] mehrere bilder support vom emil kopiert ;) --- dvd-logo.png | Bin 5205 -> 0 bytes main.py | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) delete mode 100644 dvd-logo.png diff --git a/dvd-logo.png b/dvd-logo.png deleted file mode 100644 index 0607dd46ceff71c4acbf88febce1ece0a2cc528f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5205 zcmeHKc~n#95>E&!yBerqMTsdQh*=3_DPc_zkRU=psO7=Uy*Cgb3rW~TL8$^-R0x(@ zwOFwzSa50G5JfEt)D<402uMYX3)HO^DFW|HK*aNU&O4s-`k%?Ux%ZoI<~K9HnQu;R zUQpl?Q=^ZKFc^%fpD!;M+syFkBrBr4STKxmc2b64Yr5lz^s6 z#28F!yEJH}8E(G8>s|})T37WmmaNUL)^l@|#nFh{f#;}R)-xYe_u^!@9KAv&=_d`c zWl`~VLqUPd?4p2O4;G{!zp>kw(cqu(_3*w#>{ZTc6IbVuK~dR2Y+wAI3%IfFk2%vF@poc5w&qwL>?Zt1+?=&<}q_)T%_w>xFwc+gciTrk$SGo81Jr( zeD>-~)mbzuU@R$ zdBYwb{xjY-HzlSoSaKcqOzHj>~Lj+~OU zd!e@ry27X#|2(aGc++VIW0NjDZhTkA_Fh&drkPQB&s3o>*koy+(b?PC*{>QpR?a?S zBjhNzf7`Y{AGBSn1hiMUAb3FRX}h&swRlg7>SHad{T3U zNRS|0;tFR0RiN-jVCzVUo;c~#U zR!kuhbSmn2E-_pXMDUg?Q38X^AX7>FR7oJu%*7zPhj!AgljEs@IzT1-eJPf~M< zM6geI6Q5Ke5KO?!RO2iFJ}9Y>f{!}f}jZtEd?z&xNJGyix2Lj9|aNp5>le3Izpo|Q5bfa1hGsh0bL0tOpZzmg#ai9!~hUp-L6#L@g$bN_JxC%(Z3V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noi<|i(Y<4om|S(h+ni7ieeJ2zP@s_1QNy!5=s@O0l- zJ6jN=j{2dcY*EL9v|tBj;T;%{Es`BrRe{1MqA{XiTAo2k#R6>6y!B?9I@{vHEWbNg z1OI6JOzOk(iv6GI73Kb3SabMgZ_NGGnk>UDrYqz1?6T_20x+{+igi(cQvhLRp97~f@9tpW?vj?LN4%s&0U{;`NCjc&3rC% z>N7{h;l>(wHYIKA03j21$$?tczT`3fL3zMp+{;&YH}vDreSXlU|M)Fs-c(Yud15Lr5cuRBgG zt-%hC=ASr{*E+B*@;6)0!KToj;d?(WUO)S|@|5F~o~qAX4>vfKiyv+M#yzSwCv3&S zLoWms!71pOj6+sdRk2S;cK&KYt(vCd&sj11ioMw~i-Bs#Ej@0VPyDiat=n|gj5%3` z(e3k&Ux{A3?P!)9Us5-vYnJk{O&>weE|Y5cY?_B2qt5ob`oE?RN%XG9KK-i-Ob3h~ LKaf}D6}|R9NsrNL diff --git a/main.py b/main.py index bf23e22..ddd5aa7 100755 --- a/main.py +++ b/main.py @@ -1,6 +1,8 @@ #!/usr/bin/python3 import pygame +from random import choice from random import randint as ri +import os pygame.init() default_font = pygame.font.SysFont("sans", 14) @@ -24,18 +26,24 @@ screensize = pygame.display.get_window_size() clock = pygame.time.Clock() +working_directory = os.path.dirname(os.path.realpath(__file__)) +images = [] +for image in os.listdir(f"{working_directory}/dvds"): + images.append(pygame.image.load(f"{working_directory}/dvds/{image}")) + scales = 1 speeds = 1 class DVD(): def __init__(self,scale,speed): self.newcolor() - self.dvd = pygame.image.load("dvd-logo.png") + + self.dvd = choice(images) self.size = self.dvd.get_size() self.scale = scale self.speed = speed self.pos = ri(0,screensize[0]-self.size[0]),ri(0,screensize[1]-self.size[1]) - self.get_dvd(False) + self.get_dvd(inverse) self.richtung = ["r","u"] @@ -89,7 +97,7 @@ class DVD(): dvds = [] -dvds.append(DVD(1,1))#ri(1,10))) +dvds.append(DVD(1,1,"dvds/dvd-logo.png"))#ri(1,10))) def get_debug_text(): @@ -132,7 +140,7 @@ if __name__ == "__main__": if pressed_keys[pygame.K_LEFT] and scales>=0.2: scales -= 0.1 if pressed_keys[pygame.K_PLUS] and not preview_pressed_keys[pygame.K_PLUS]: - dvds.append(DVD(1,1)) #ri(1,30))) + dvds.append(DVD(1,1,"dvds/dvd-logo.png")) #ri(1,30))) if pressed_keys[pygame.K_MINUS] and not preview_pressed_keys[pygame.K_MINUS] and not len(dvds) == 0: dvds.pop(0)