pre function save
This commit is contained in:
parent
f5d3638815
commit
3a1ee83060
22
board.py
Normal file
22
board.py
Normal 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")
|
||||||
3
main.py
3
main.py
@ -1,4 +1,5 @@
|
|||||||
import pygame as pg
|
import pygame as pg
|
||||||
|
from board import render_board
|
||||||
|
|
||||||
#chess pieces
|
#chess pieces
|
||||||
p1 = "pawn"
|
p1 = "pawn"
|
||||||
@ -48,8 +49,6 @@ while running: #open window
|
|||||||
s1 = not s1
|
s1 = not s1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#flip display to put game on screen
|
#flip display to put game on screen
|
||||||
pg.display.flip()
|
pg.display.flip()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user