From 7bb88ebd07c76c65deac22b3d3139bc725973750 Mon Sep 17 00:00:00 2001 From: milanjaeckel Date: Sun, 10 May 2026 09:43:55 +0200 Subject: [PATCH] figured out how to draw a rectangle --- main.py | 10 ++++------ readme.md | 3 ++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 696aeab..2f8e5a1 100644 --- a/main.py +++ b/main.py @@ -2,14 +2,12 @@ import pygame as pg #start pygame pg.init() -screen = pg.display.set_mode((800, 600)) +screen = pg.display.set_mode((800, 800)) #window (size) clock = pg.time.Clock() running = True +color = (0, 0, 0) #rectangle color -while running: - - lead_x = 20 - lead_y = 20 +while running: #open window for event in pg.event.get(): if event.type == pg.QUIT: @@ -19,7 +17,7 @@ while running: screen.fill("white") #chess game - pg.draw.rect() + pg.draw.rect(screen, color, pg.Rect(0, 0, 100, 100)) #flip display to put game on screen diff --git a/readme.md b/readme.md index 1757660..aa51c50 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,5 @@ "Chess game" ---SOURCES--- -https://www.pygame.org/docs/tut/ImportInit.html \ No newline at end of file +https://www.pygame.org/docs/tut/ImportInit.html +https://www.geeksforgeeks.org/python/how-to-draw-rectangle-in-pygame/ \ No newline at end of file