MCPcopy Create free account
hub / github.com/ActiveState/code / pause

Function pause

recipes/Python/578996_Snake_the_game/recipe-578996.py:69–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67 clock.tick(15)
68
69def pause():
70
71 paused=True
72
73 message_to_screen("Paused",black,-100,size="large")
74 message_to_screen("Press C to continue or Q to quit",black,25)
75
76 pygame.display.update()
77
78 while paused:
79 for event in pygame.event.get():
80 if event.type==pygame.QUIT:
81 pygame.quit()
82 quit()
83 if event.type==pygame.KEYDOWN:
84 if event.key==pygame.K_c:
85 paused=False
86 elif event.key==pygame.K_q:
87 pygame.quit()
88 quit()
89
90 clock.tick(5)
91
92def score(score):
93

Callers 2

gameLoopFunction · 0.70
roll_filmMethod · 0.50

Calls 6

message_to_screenFunction · 0.85
quitFunction · 0.50
updateMethod · 0.45
getMethod · 0.45
quitMethod · 0.45
tickMethod · 0.45

Tested by

no test coverage detected