def ProcessInput(self, events): for event in events: if event.type == pygame.KEYDOWN and event.key == pygame.K_F8: self.next = Menus.GameWin(self) if event.type == pygame.MOUSEMOTION and self._story_r: x = event.pos[0] y = event.pos[1] if (self._story_r.collidepoint(x, y)): self._hover = STORY elif (self._custom_r.collidepoint(x, y)): self._hover = CUSTOM elif (self._intro_r.collidepoint(x, y)): self._hover = INTRO elif (self._credits_r.collidepoint(x, y)): self._hover = CREDITS elif (self._quit_r.collidepoint(x, y)): self._hover = QUIT else: self._hover = NONE elif event.type == pygame.MOUSEBUTTONUP and event.button == 1: x = event.pos[0] y = event.pos[1] if not self._story_r: return if (self._story_r.collidepoint(x, y)): self.next = PlayScene(LevelSeed('level1', None)) elif (self._custom_r.collidepoint(x, y)): self.next = Menus.MapOptions() elif (self._intro_r.collidepoint(x, y)): self.next = Menus.Intro() elif (self._credits_r.collidepoint(x, y)): self.next = Menus.Credits() elif (self._quit_r.collidepoint(x, y)): self.next = None
def Update(self): self.next = Menus.GameWin(self.previousScene)