Closed blankRiot96 closed 1 year ago
This looks good, but there is one other way that I've used before:
If your game loop is in a function like main
, then just return
after the QUIT
event works too. Not sure that one should be mentioned though
Had mentioned on discord too: You are right and that is indeed a valid way to exit the application! But I don't think you would see it in a more structural larger game(mostly because there is some complexity involved to work around it for it to be used) and I want to build the foundation for that!
But it is definitely a valid thing and it may have been worth mentioning if I had a main
function already. Unfortunately I did not create a main
function to contain my code to keep it as simple as possible
Covered a few different styles of exiting a
pygame
application and the benefits of each.