From 58d887689e6419cf1115ed714800ae8ff389bf49 Mon Sep 17 00:00:00 2001 From: Kevin Baumgartner Date: Fri, 8 May 2026 15:33:15 +0200 Subject: [PATCH] feat(endscreen): get font from settings --- src/endscreen.py | 14 ++++++++++---- src/settings.py | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/endscreen.py b/src/endscreen.py index 755f056..4a4571b 100644 --- a/src/endscreen.py +++ b/src/endscreen.py @@ -1,6 +1,12 @@ import pygame from button import Button -from settings import COLOR_ENDSCREEN_BACKGROUND, COLOR_ENDSCREEN_TEXT, COLOR_ENDSCREEN_WIN, COLOR_ENDSCREEN_LOSE, COLOR_BUTTON_HOVER, COLOR_BUTTON +from settings import (COLOR_ENDSCREEN_BACKGROUND, + COLOR_ENDSCREEN_TEXT, + COLOR_ENDSCREEN_WIN, + COLOR_ENDSCREEN_LOSE, + COLOR_BUTTON_HOVER, + COLOR_BUTTON, + FONT_ENDSCREEN) class Endscreen: def __init__(self, screen, player_name, score_ects, time_survived, won): @@ -11,9 +17,9 @@ class Endscreen: self.won = won # setup fonts - self.font_title = pygame.font.SysFont("Arial", 52, bold=True) - self.font_label = pygame.font.SysFont("Arial", 28) - self.font_small = pygame.font.SysFont("Arial", 22) + self.font_title = pygame.font.SysFont(FONT_ENDSCREEN, 52, bold=True) + self.font_label = pygame.font.SysFont(FONT_ENDSCREEN, 28) + self.font_small = pygame.font.SysFont(FONT_ENDSCREEN, 22) # setup colors self.background_color = COLOR_ENDSCREEN_BACKGROUND diff --git a/src/settings.py b/src/settings.py index 88011de..0ef6b21 100644 --- a/src/settings.py +++ b/src/settings.py @@ -35,6 +35,7 @@ COLOR_ENDSCREEN_BACKGROUND = ((0, 0, 0)) COLOR_ENDSCREEN_TEXT = (255, 255, 255) COLOR_ENDSCREEN_WIN = (0, 255, 0) COLOR_ENDSCREEN_LOSE = (255, 0, 0) +FONT_ENDSCREEN = "Arial" # --- COFFEE --- COFFEE_COST = 30