diff --git a/gamemenu.py b/gamemenu.py index d1b5be7..932d0c6 100755 --- a/gamemenu.py +++ b/gamemenu.py @@ -204,7 +204,7 @@ class TestInput(AbstractInput): pygame = self.__pygame for event in pygame.event.get(): if event.type == pygame.KEYDOWN: - if self.control.get(event.key, None) == InputEvent.STEP_ON: + if self.controls.get(event.key, None) == InputEvent.STEP_ON: self.player_present = True return self.controls.get(event.key, None) return None @@ -342,12 +342,17 @@ if __name__ == '__main__': games = Game.__subclasses__() game_idx = 0 old_idx = -1 + lastrefresh = 0 while True: if old_idx != game_idx: gamecls = games[game_idx] game = gamecls() - out.sendFrame(create_menu_frame(dim, game)) old_idx = game_idx + lastrefresh = 0 + + if time.time() >= lastrefresh+1: + out.sendFrame(create_menu_frame(dim, game)) + lastrefresh = time.time() evt = inp1.get_event() if evt == InputEvent.LEFT: