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

Method eventLoop

recipes/Python/578808_Python_Game_of_Life/recipe-578808.py:174–187  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

172 pygame.display.update()
173
174 def eventLoop(self):
175 # the main event loop, detects keypresses
176 for event in pygame.event.get():
177 if event.type == QUIT:
178 pygame.quit()
179 sys.exit()
180 if event.type == KEYDOWN:
181 if event.key == K_RETURN:
182 self.running = True
183 if event.key == K_SPACE:
184 self.running = False
185 self.sprites.empty()
186 self.cells = []
187 self.createGrid()
188
189
190 def Tick(self):

Callers 1

LoopMethod · 0.95

Calls 5

createGridMethod · 0.95
getMethod · 0.45
quitMethod · 0.45
exitMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected