feat(startscreen): add exit/quit functionality

This commit is contained in:
Kevin Baumgartner
2026-05-07 19:38:16 +02:00
parent 80c56ad447
commit 49c6d485db
+13 -1
View File
@@ -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
# 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"