Pygame - "error: Display Surface Quit"
I've made a menu screen where clicking on a button leads to a different screen in the same window. def main():     import pygame, random, time     pygame.init()      size=[800, 600
Solution 1:
Several possibilities:
- end the process (with e.g. sys.exit()) in theviewfunction. Not ideal.
- return a value from the viewfunction to indicate that the application shoud end (e.g.return done), and check for that return value in themainfunction (if done: return). Better.
- make doneglobal and check for its value in themainfunction. I really would not like this solution.
- my favourite: avoid multiple event loops altogether, so the problem solves itself (so you could just e.g. exit the mainfunction with return).
Post a Comment for "Pygame - "error: Display Surface Quit""