0

I'm using Python version 3.7.6 and Pygame version 2.1.2 and anytime I run even the simplest bit of code to open a window and draw shapes to it, the window doesn't respond correctly and has to be forced to close.

Below is what I'm currently trying to run, but regardless of what's drawn to the window I end up with the same issue. The window stops responding after everything runs - without any other issues I can see, the correct images are drawn onto the window.

I've tried using different versions of both Python and Pygame, but end up with the same issue every time.

import pygame
pygame.init()

display = pygame.display.set_mode((500,150), pygame.SRCALPHA, 32)
display.fill ((255,255,255))

pygame.draw.circle (display, (255,0,0,255), (50,50), 30)
pygame.draw.circle (display, (0,255,0,255), (75,75), 30)

surf = pygame.Surface((60,60), flags=pygame.SRCALPHA)
pygame.draw.circle (display, (255, 0, 0), (150,50),30)
pygame.draw.circle (surf, (0, 255, 0, 200), (30,30),30)
display.blit(surf, (150,40))

surf = pygame.Surface((60,60), flags=pygame.SRCALPHA)
pygame.draw.circle (display, (255,0,0), (250,50), 30)


pygame.draw.circle (surf, (0, 255, 0, 128), (130,30),30)
display.blit(surf, (250,40))

surf = pygame.Surface((60,60), flags=pygame.SRCALPHA)
pygame.draw.circle (display, (255, 0, 0), (350, 50),30)
pygame.draw.circle (surf, (0,255,0,96), (30,30),30)
display.blit(surf, (350,40))

pygame.display.update()
input()

Circles drawn to window in Pygame

0 Answers0