From 2957bb867f28807e22d607f31300f06d91d9d117 Mon Sep 17 00:00:00 2001 From: Nicholas Dyer Date: Mon, 6 Jan 2025 23:12:14 -0500 Subject: [PATCH] added the ability to quit by pressing esc. --- steam_saver/surfaces/steam_screen.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/steam_saver/surfaces/steam_screen.py b/steam_saver/surfaces/steam_screen.py index 7cd9c0b..0df0475 100644 --- a/steam_saver/surfaces/steam_screen.py +++ b/steam_saver/surfaces/steam_screen.py @@ -197,6 +197,11 @@ class Surface(pygame.Surface): # Stop the game when a user clicks anywhere on the screen. self.running = False self.quit = True + case pygame.KEYDOWN: + if event.key == pygame.K_ESCAPE: + # Also stop the game if the Escape key is pressed. + self.running = False + self.quit = True # Update positions and speeds of all sprites (in this case, just one logo sprite). self.all_sprites.update()