Pygame

How To Draw A Color Rectangle In Pygame

The python pygame.Rect(top, left, width, height) class is used to create a rectangle object. You can specify the rectangle object’s position (top, left) and size (width, height) when you create it. And the rectangle represented area must be drawn on a pygame surface object. This article will tell you how to use the pygame.Rect object

How To Draw A Color Rectangle In Pygame Read More »

How To Fix Pygame.PixelArray IndexError: Invalid Index Error

I create a pygame.PixelArray object uses the pygame main screen window surface object ( returned by the method pygame.display.set_mode() ), and when I assign color to each item of the pygame.PixelArray object in a loop it throws the error pygame.PixelArray IndexError: invalid index. This article will tell you how to fix it.

How To Fix Pygame.PixelArray IndexError: Invalid Index Error Read More »