rendered full chessboard (hardcoded)
This commit is contained in:
parent
dcc49da024
commit
d1a4ae17a1
48
main.py
48
main.py
@ -5,7 +5,12 @@ pg.init()
|
|||||||
screen = pg.display.set_mode((800, 800)) #window (size)
|
screen = pg.display.set_mode((800, 800)) #window (size)
|
||||||
clock = pg.time.Clock()
|
clock = pg.time.Clock()
|
||||||
running = True
|
running = True
|
||||||
color = (0, 0, 0) #rectangle color
|
|
||||||
|
color = (255, 255, 255) #rectangle color
|
||||||
|
positionX = 0 #recatangle position x
|
||||||
|
positionY = 0 #recatangle position y
|
||||||
|
size = 100, 100 #rectangle size
|
||||||
|
|
||||||
|
|
||||||
while running: #open window
|
while running: #open window
|
||||||
|
|
||||||
@ -14,10 +19,49 @@ while running: #open window
|
|||||||
running = False
|
running = False
|
||||||
|
|
||||||
#render frame
|
#render frame
|
||||||
screen.fill("white")
|
screen.fill("black")
|
||||||
|
|
||||||
#chess game
|
#chess game
|
||||||
pg.draw.rect(screen, color, pg.Rect(0, 0, 100, 100))
|
pg.draw.rect(screen, color, pg.Rect(0, 0, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(200, 0, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(400, 0, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(600, 0, 100, 100))
|
||||||
|
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(100, 100, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(300, 100, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(500, 100, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(700, 100, 100, 100))
|
||||||
|
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(0, 200, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(200, 200, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(400, 200, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(600, 200, 100, 100))
|
||||||
|
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(100, 300, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(300, 300, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(500, 300, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(700, 300, 100, 100))
|
||||||
|
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(0, 400, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(200, 400, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(400, 400, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(600, 400, 100, 100))
|
||||||
|
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(100, 500, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(300, 500, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(500, 500, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(700, 500, 100, 100))
|
||||||
|
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(0, 600, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(200, 600, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(400, 600, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(600, 600, 100, 100))
|
||||||
|
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(100, 700, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(300, 700, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(500, 700, 100, 100))
|
||||||
|
pg.draw.rect(screen, color, pg.Rect(700, 700, 100, 100))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#flip display to put game on screen
|
#flip display to put game on screen
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user