diff --git a/snake/input_manager.py b/snake/input_manager.py index 33244b1..5fb2344 100644 --- a/snake/input_manager.py +++ b/snake/input_manager.py @@ -5,6 +5,13 @@ class InputManager: QUIT = 0 def process_input(self): + last_input = None + for event in pygame.event.get(): if event.type == pygame.QUIT: - return InputManager.QUIT \ No newline at end of file + last_input = InputManager.QUIT + elif event.type == pygame.KEYDOWN: + if event.key == pygame.K_ESCAPE: + last_input = InputManager.QUIT + + return last_input