From 49c6d485db7a164940805f613f4503a733e77cf0 Mon Sep 17 00:00:00 2001 From: Kevin Baumgartner Date: Thu, 7 May 2026 19:38:16 +0200 Subject: [PATCH] feat(startscreen): add exit/quit functionality --- src/startscreen.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/startscreen.py b/src/startscreen.py index ad9d7c6..60c51ff 100644 --- a/src/startscreen.py +++ b/src/startscreen.py @@ -7,6 +7,7 @@ class Startscreen: self.font_title = pygame.font.SysFont("Arial", 36) self.font_label = pygame.font.SysFont("Arial", 20) + # todo buttons must be initialized here def run(self): # set background color @@ -17,5 +18,16 @@ class Startscreen: self.screen.blit(title, (10, 10)) message = self.font_label.render("Welcome to FH - Study with purpose", True, (0, 255, 255)) + # todo buttons must be drawn here + # todo check button events/click - return None \ No newline at end of file + # check key down events - exit/quit + for event in pygame.event.get(): + if event.type == pygame.QUIT: + return "quit" + + if event.type == pygame.KEYDOWN: + if event.key == pygame.K_ESCAPE: + return "quit" + + return "startscreen" \ No newline at end of file