diff --git a/README.md b/README.md index 224dd00..c815657 100644 --- a/README.md +++ b/README.md @@ -36,4 +36,8 @@ To evaluate the competitivity of the AI player (`WHITE`), 100 iterations of 100 The `BLACK` player always starts first and is the human player. The `WHITE` player starts second and is the AI player. ## Credits +### Assets "Board Game Set - Checkers & Merels" [Game asset]. (n.d.). itch.io. Retrieved May 22, 2023, from https://mrserji.itch.io/board-game-set-checkers-merels + +### Fonts +This project uses the [Open Sans](https://fonts.google.com/specimen/Open+Sans) font. diff --git a/assets/fonts/OpenSans-Medium.ttf b/assets/fonts/OpenSans-Medium.ttf new file mode 100644 index 0000000..a76d4ce Binary files /dev/null and b/assets/fonts/OpenSans-Medium.ttf differ diff --git a/checkers/graphics/sprites/square.py b/checkers/graphics/sprites/square.py index 8df32df..b8deab5 100644 --- a/checkers/graphics/sprites/square.py +++ b/checkers/graphics/sprites/square.py @@ -39,7 +39,7 @@ def _set_text(self, row: int, col: int) -> None: :param int col: column position of the square """ color = WHITE if row % 2 != col % 2 else BLACK - self.font = pygame.font.SysFont("Arial", 9) + self.font = pygame.font.Font("assets/fonts/OpenSans-Medium.ttf", 9) self.text_surface = self.font.render(f"{row},{col}", True, color) self.image.blit( self.text_surface, diff --git a/checkers/graphics/window.py b/checkers/graphics/window.py index 6a093bc..1201bab 100755 --- a/checkers/graphics/window.py +++ b/checkers/graphics/window.py @@ -272,7 +272,7 @@ def _slide_piece(self, sprite: PieceSprite, move: tuple) -> None: def display_winner(self) -> None: # Text - font = pygame.font.SysFont("Arial", 24) + font = pygame.font.Font("assets/fonts/OpenSans-Medium.ttf", 24) text = font.render(f"Winner: {self.game.winner}", True, WHITE) # Rect @@ -294,13 +294,13 @@ def display_winner(self) -> None: self.screen.blit(text, (text_x, text_y)) # Turn text - font = pygame.font.SysFont("Arial", 20) + font = pygame.font.Font("assets/fonts/OpenSans-Medium.ttf", 20) text = font.render(f"Turn: {self.game.turn}", True, WHITE) text_x = rect.centerx - text.get_width() // 2 self.screen.blit(text, (text_x, text_y - 34)) # "Click anywhere to exit" text - font = pygame.font.SysFont("Arial", 12) + font = pygame.font.Font("assets/fonts/OpenSans-Medium.ttf", 12) text = font.render(f"Press any keystroke to exit", True, WHITE) text_x = rect.centerx - text.get_width() // 2 self.screen.blit(text, (text_x, text_y + 40))