I'm using Pygame but I can not get my objects to draw correctly. I do not get any errors and the application responds correctly. The objects are displayed correctly in the console (with print
), only the display appears black.
This is my code:
def draw_enviroment(blobs):
game_display.fill(WHITE)
for blob_id in blobs:
blob = blobs[blob_id]
pygame.draw.circle(game_display, blob.color, [blob.x, blob.y], blob.size)
blob.move()
pygame.display.update()
def main():
blue_blobs = dict(enumerate([Blob(BLUE, i) for i in range(STARTING_BLUE_BLOBS)]))
print(blue_blobs)
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
draw_enviroment(blue_blobs)
clock.tick(60)
if __name__ == "__main__":
main()