Last updated 6 days ago
I was wondering what the command was for ending the program for example GAME OVER when the player makes the wrong decision and stopping all the code after that?
You can call the quit() function and that will stop all code from running. You can also structure your code so that the condition in your game loop turns to False when you want the game to stop. For example:
playing = True while playing: if <game over condition is True>: playing = False
That way the loop will keep going until the game over condition becomes True.
Become a free member to post a comment about this question.