I'm trying to use pygame to render an environment in python. Globally, I've initialized pygame and the display with the lines:
pygame.init()
dis = pygame.display.set_mode((dis_width, dis_height))
pygame.display.set_caption('Snake Game Environment')
Then, inside the environment's render method, I begin by filling the environment with a black color with the line:
dis.fill(black)
When this method is first called, I get the error:
"pygame.error: display Surface quit"
I've tried colors other than black and get the same error. This problem only occurs when I call dis.fill inside the class's method.