diff --git a/gamemenu.py b/gamemenu.py index b9d7c9c..7e32f8a 100755 --- a/gamemenu.py +++ b/gamemenu.py @@ -325,7 +325,12 @@ if __name__ == '__main__': inp1 = BalanceInput((host, int(port)), 0) inp2 = BalanceInput((host, int(port)), 1) - while inp1.get_event() != InputEvent.STEP_ON: + while True: + evt = inp1.get_event() + if evt == InputEvent.STEP_ON: + break + elif evt == InputEvent.QUIT: + sys.exit() time.sleep(0.05) init_frame = create_init_screen(dim) @@ -363,11 +368,15 @@ if __name__ == '__main__': wait_time = 3 start = time.time() while time.time() < start+wait_time: - if inp2.get_event() == InputEvent.STEP_ON: - inp1.running = False - inp2.running = False - start_game(game, 2) - time.sleep(0.1) + while True: + evt = inp2.get_event() + if evt == InputEvent.STEP_ON: + inp1.running = False + inp2.running = False + start_game(game, 2) + elif evt == InputEvent.QUIT: + sys.exit() + time.sleep(0.1) inp1.running = False inp2.running = False