def handleEvent(self, event):
     if BaseContext.handleEvent(self, event):
         return True
     elif event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE:
         self._setContextFunc(self._gameContext)
         return True
     return False
예제 #2
0
    def handleEvent(self, event):
        if BaseContext.handleEvent(self, event):
            return True

        from context.gamepausecontext import GamePauseContext
        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_ESCAPE:
                self._setContextFunc(
                    GamePauseContext(self, self._setContextFunc))

        return False
예제 #3
0
    def handleEvent(self, event):
        if BaseContext.handleEvent(self, event):
            return True

        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_ESCAPE:
                from context.gamepausecontext import GamePauseContext
                self._setContextFunc(GamePauseContext(self, self._setContextFunc))
            elif event.key == pygame.K_TAB:
                self.drawmode = (self.drawmode + 1) % 4
        return False