MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / checkForQuit

Function checkForQuit

src/gamesbyexample/pygame_games/simulate.py:142–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

140
141
142def checkForQuit():
143 for event in pygame.event.get(QUIT): # get all the QUIT events
144 terminate() # terminate if any QUIT events are present
145 for event in pygame.event.get(KEYUP): # get all the KEYUP events
146 if event.key == K_ESCAPE:
147 terminate() # terminate if the KEYUP event was for the Esc key
148 pygame.event.post(event) # put the other KEYUP event objects back
149
150
151def flashButtonAnimation(color, animationSpeed=50):

Callers 4

mainFunction · 0.70
flashButtonAnimationFunction · 0.70
gameOverAnimationFunction · 0.70

Calls 1

terminateFunction · 0.70

Tested by

no test coverage detected