From a15dd6da408ccf39b4e96e633a8b1c6c178ee357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Martin=20J=C3=A4ckel?= Date: Thu, 4 Jun 2026 16:43:14 +0200 Subject: [PATCH] added file to render pieces on board --- renderPieces.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 renderPieces.py diff --git a/renderPieces.py b/renderPieces.py new file mode 100644 index 0000000..ea0b755 --- /dev/null +++ b/renderPieces.py @@ -0,0 +1,15 @@ +import pygame + + + +class ChessPiece(pygame.sprite.Sprite): + def __init__(self, image_path, x, y): + super().__init__() + + self.image = pygame.image.load(image_path).convert_alpha() + + # 3. Get the bounding box (Rect) of the image + self.rect = self.image.get_rect() + + # 4. Set the initial position of the Rect + self.rect.topleft = (x, y) \ No newline at end of file