pre function save

This commit is contained in:
milanjaeckel 2026-05-17 19:45:59 +02:00
parent f5d3638815
commit 3a1ee83060
2 changed files with 23 additions and 2 deletions

22
board.py Normal file
View File

@ -0,0 +1,22 @@
import pygame as pg
def render_board():
posX, posY = 0, 0 #recatangle position x, recatangle position y
s1 = True #wether or not the first square of the row should be black or white
#render frame
screen.fill("black")
#chess game
while posY < size:
posX = 0
if not s1:
posX = posX + size / 8
while posX <= size:
pg.draw.rect(screen, color, (posX, posY, sizeW, sizeH))
posX = posX + size / 4
posY = posY + size / 8
s1 = not s1
def test_def():
print("This is a test")

View File

@ -1,4 +1,5 @@
import pygame as pg
from board import render_board
#chess pieces
p1 = "pawn"
@ -47,8 +48,6 @@ while running: #open window
posY = posY + size / 8
s1 = not s1
#flip display to put game on screen
pg.display.flip()