Skip to content
← Back to Community
Pygame drawing rect
Profile icon
ash15khng

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 [earned 5 cycles]
View Answer
Voters
Profile icon
Virianium
Profile icon
ash15khng
Comments
hotnewtop
Profile icon
JustARatherRidi

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

Profile icon
ash15khng

@JustARatherRidi Thanks, it works now!

Profile icon
JustARatherRidi

@ash15khng Anytime! ^^