def handleEvents(self, events):
for event in events:
if event.type == pygame.QUIT:
self.doQuit()
return
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
self.doQuit()
return
elif event.key == pygame.K_DOWN:
self.current_option += 1
if self.current_option >= len(self.options):
self.current_option = 0
elif event.key == pygame.K_UP:
self.current_option -= 1
if self.current_option < 0:
self.current_option = len(self.options)-1
elif event.key == pygame.K_RETURN:
self.currentOptionExecute()
return
评论列表
文章目录