From ef38b7abbffae1e91582fdef4b4443b1d9dda5a1 Mon Sep 17 00:00:00 2001 From: Traumi-Schlumpf Date: Thu, 12 Mar 2026 17:14:57 +0100 Subject: [PATCH] Set 800x800 window, add icon and caption Load and set a window icon (assets/graphics/icon.png) and change the display caption to 'Schach'. Use a fixed 800x800 window by introducing width/height variables, position the Brett at (0,0) instead of centering, and tidy the main loop by removing debug input and keeping clock.tick(60). Added the icon asset and a brief inline comment about class placement. --- Brett.py | 18 ++++++++++-------- assets/graphics/icon.png | Bin 0 -> 574 bytes 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 assets/graphics/icon.png diff --git a/Brett.py b/Brett.py index 9fbf7dc..bd6589b 100644 --- a/Brett.py +++ b/Brett.py @@ -1725,16 +1725,21 @@ def getFieldByCords(self, pos:tuple[int, int])->Feld|None: if __name__ == "__main__": pygame.init() - screen = pygame.display.set_mode((1920, 1080)) - pygame.display.set_caption('Brett Test') + icon = pygame.image.load("assets/graphics/icon.png") + width = 800 + height = width + screen = pygame.display.set_mode((width, height)) + + pygame.display.set_caption('Schach') + pygame.display.set_icon(icon) clock = pygame.time.Clock() TestBrettGroup = pygame.sprite.GroupSingle() - Spielbrett = Brett(800, (1920/2-400, 1080/2-400), "#eeeed1", "#739754") + Spielbrett = Brett(800, (0, 0), "#eeeed1", "#739754") TestBrettGroup.add(Spielbrett) - + # Theoretisch in die Klasse einbaubar, jedoch dagegen entschieden. while True: screen.fill((30,30,30)) for event in pygame.event.get(): @@ -1759,7 +1764,4 @@ def getFieldByCords(self, pos:tuple[int, int])->Feld|None: TestBrettGroup.draw(screen) TestBrettGroup.update() pygame.display.update() - clock.tick(60) - #Spielbrett.setRotation(int(input())) - - + clock.tick(60) \ No newline at end of file diff --git a/assets/graphics/icon.png b/assets/graphics/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f6f4992a99a9d5f01a4346ad8fdba544dcffab99 GIT binary patch literal 574 zcmV-E0>S->P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0nTQdUZdKm%$+&|pO&@7ue@E5G=070Et zvvXo~2b}9+t%bFAlMhx2aIS|j1|bB55H^XZ3UIDZYbmGWm{yHj833EDwKj_#4j(C| zK?V75z4t)DE13zYy#Ua4U5eAS_a4TW$vwJH_jo?P_TFbACIYCqd^m>}qC738L3vz6 z)dO4Ux-P9@7}6*>sRJ#$Cqf8Wo)(j6qsTfCLXe>ht&kRzXwRMqh%q9@h+!DijR2R#{eGVo8L0+09G#FYU7U0Pq6^wiG$B;9 z1UH{N$T9(7r0z`uem%yyvkJ+F;q&Ul=v0Ij&z1%kh-ttM<9fiWf>N+o#V+PT1K z7SIZb;A5!KEFi{M+?6a!tA(luQ1HPLYV${nfH_{CUS((z%_F!LzuKV=_G}%;k^lez M07*qoM6N<$f)FY22mk;8 literal 0 HcmV?d00001