Ask coding questions

← Back to all posts
1
Pygame drawing rect
ash15khng (215)

https://repl.it/@ash15khng/pygame-test
Basically I tried to draw a rect as you can see in the code. I don't get why it's not drawing tho.

Answered by JustARatherRidi (185) [earned 5 cycles]
View Answer
Commentshotnewtop
1
JustARatherRidi (185)

The problem here is that you're drawing your background over your rectangle. Do screen.fill(bgcolor) before you draw your rectangle, and you should be good.

Working repl: https://repl.it/@JustARatherRidi/pygame-test