Skip to content
Advertisement

How to draw rectangles from a list in pygame

It says rect argument is invalid but when I give the same rect without a variable it works, here is the part of a code responsible for it

JavaScript

I also tried self.obstacleses(0) in pygame.draw.rect but then i get list object is not callable.

Advertisement

Answer

You have to draw the rectangles in a loop:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement