pygame-guide-for-sneks / pygame-guide-for-sneks.github.io

https://pygame-guide-for-sneks.github.io
MIT License
12 stars 8 forks source link

Elaborating exiting pygame applications #53

Closed blankRiot96 closed 1 year ago

blankRiot96 commented 2 years ago

Covered a few different styles of exiting a pygame application and the benefits of each.

oddbookworm commented 2 years 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

blankRiot96 commented 2 years ago

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

oddbookworm commented 1 year ago

61 replaced this PR, so I'm closing it