Skip to content
Advertisement

Python/Pygame : “pygame.error: display Surface quit”

So, I’m making a game project, and I decided, for once, to make a custom class for my pygame window, like so :

JavaScript

And, in the gameloop, I decided to make an instance of this class, and to call the

JavaScript

method, like so :

JavaScript

But when I try to run the main loop, it gives me this error message (that I never saw before) :

JavaScript

And, except maybe for THAT particular line :

JavaScript

I really don’t know why it happens. Maybe it’s because it’s not possible to make a custom Screen class ?

So my question is : Why is this happening ? If I can make a custom window class, how ? Because it doesn’t seem to work…

Any help would be greatly welcome!

EDIT 1: If you need the code of all the files, I will make them visible :D

Advertisement

Answer

Try initializing the parent class. Inside your init function.

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