| 7 | |
| 8 | |
| 9 | class Application: |
| 10 | SCREEN_WIDTH = 1200 |
| 11 | SCREEN_HEIGHT = 800 |
| 12 | |
| 13 | LIGHT = 1 |
| 14 | DARK = 0 |
| 15 | |
| 16 | def __init__(self) -> None: |
| 17 | """Initiliase the Application Object with the necessary initialisations.""" |
| 18 | |
| 19 | self.game_board = Board() |
| 20 | |
| 21 | # pygame initialisations |
| 22 | self.screen = pygame.display.set_mode( |
| 23 | (Application.SCREEN_WIDTH, Application.SCREEN_HEIGHT) |
| 24 | ) |
| 25 | self.theme = Application.LIGHT |
| 26 | self.BG = [Colors.CHARCOAL, Colors.WHITE] |
| 27 | self.screen.fill(self.BG[self.theme]) |
| 28 | pygame.display.flip() |
| 29 | |
| 30 | pygame.display.set_caption("Othello/Reversi") |
| 31 | |
| 32 | # image initialisations |
| 33 | self.boardIMG = [ |
| 34 | pygame.image.load("images/Dark-Mode/Othello_Black_Side_Board.png"), |
| 35 | pygame.image.load("images/Light-Mode/Othello_Black_Side_Board.png"), |
| 36 | ] |
| 37 | |
| 38 | self.endScreenBlackIMG = [ |
| 39 | pygame.image.load("images/Dark-Mode/End_Screen_Black.png"), |
| 40 | pygame.image.load("images/Light-Mode/End_Screen_Black.png"), |
| 41 | ] |
| 42 | self.endScreenWhiteIMG = [ |
| 43 | pygame.image.load("images/Dark-Mode/End_Screen_White.png"), |
| 44 | pygame.image.load("images/Light-Mode/End_Screen_White.png"), |
| 45 | ] |
| 46 | self.endScreenDrawIMG = [ |
| 47 | pygame.image.load("images/Dark-Mode/End_Screen_Draw.png"), |
| 48 | pygame.image.load("images/Light-Mode/End_Screen_Draw.png"), |
| 49 | ] |
| 50 | self.endPromptIMG = [ |
| 51 | pygame.image.load("images/Dark-Mode/End_Prompt.png"), |
| 52 | pygame.image.load("images/Light-Mode/End_Prompt.png"), |
| 53 | ] |
| 54 | |
| 55 | self.choiceIMG = [ |
| 56 | pygame.image.load("images/Dark-Mode/Othello_Game-mode_Choice.png"), |
| 57 | pygame.image.load("images/Light-Mode/Othello_Game-mode_Choice.png"), |
| 58 | ] |
| 59 | |
| 60 | # font initialisation |
| 61 | self.discCountFont = pygame.font.Font("Gotham-Font/GothamLight.ttf", 40) |
| 62 | |
| 63 | self.single_player = False |
| 64 | self.displayed_choice = False |
| 65 | |
| 66 | self.running = True |