added file to render pieces on board

This commit is contained in:
Milan Martin Jäckel 2026-06-04 16:43:14 +02:00
parent 0b8d432697
commit a15dd6da40

15
renderPieces.py Normal file
View File

@ -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)