Skip to content

Commit 699d781

Browse files
committed
Change the font to courier
1 parent 8125f51 commit 699d781

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

PROGRESS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,4 @@
5353
- Kept unlock milestone economics by using incremental line purchase prices derived from `[0, 90, 300, 650]`.
5454
- Added locked-button hover buy hints with two lines of text (`Buy` and price), using gray text when unaffordable and black text when affordable.
5555
- Updated game rules docs for purchase-based line unlocks and the new locked-button hover/click behavior.
56+
- Changed UI font usage to `courier` via shared `font_name` config.

src/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
path_button_buy_text_font_size = 26
8585

8686
# text
87+
font_name = "courier"
8788
score_font_size = 50
8889
score_display_coords = (20, 20)
8990
game_over_font_size = 120

src/mediator.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import pygame
77
from config import (
8+
font_name,
89
max_waiting_passengers,
910
initial_num_stations,
1011
num_metros,
@@ -71,10 +72,10 @@ def __init__(self) -> None:
7172
self.path_buttons = get_path_buttons(self.num_paths)
7273
self.path_to_button: Dict[Path, PathButton] = {}
7374
self.buttons = [*self.path_buttons]
74-
self.font = pygame.font.SysFont("arial", score_font_size)
75-
self.game_over_font = pygame.font.SysFont("arial", game_over_font_size)
75+
self.font = pygame.font.SysFont(font_name, score_font_size)
76+
self.game_over_font = pygame.font.SysFont(font_name, game_over_font_size)
7677
self.game_over_hint_font = pygame.font.SysFont(
77-
"arial", game_over_hint_font_size
78+
font_name, game_over_hint_font_size
7879
)
7980
self.game_over_restart_rect: pygame.Rect | None = None
8081
self.game_over_exit_rect: pygame.Rect | None = None

src/ui/path_button.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from config import (
55
button_color,
66
button_size,
7+
font_name,
78
path_button_buffer,
89
path_button_buy_text_color,
910
path_button_buy_text_disabled_color,
@@ -110,7 +111,7 @@ def draw(
110111
if self.show_cross and locked_purchase_price is not None:
111112
if self.buy_text_font is None:
112113
self.buy_text_font = pygame.font.SysFont(
113-
"arial", path_button_buy_text_font_size
114+
font_name, path_button_buy_text_font_size
114115
)
115116
text_color = (
116117
path_button_buy_text_color

0 commit comments

Comments
 (0)