feat(endscreen): get font from settings
This commit is contained in:
+10
-4
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user