From e705e059e26cdefddfb7fc0187d6fa90271691ad Mon Sep 17 00:00:00 2001 From: miteruzo Date: Thu, 4 Apr 2024 08:33:30 +0900 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=95=B0=E3=82=AF=E3=83=A9=E3=82=B9?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common_const.py | 7 +++++++ main.py | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 common_const.py diff --git a/common_const.py b/common_const.py new file mode 100644 index 0000000..7f32eb1 --- /dev/null +++ b/common_const.py @@ -0,0 +1,7 @@ +from pydantic import BaseModel + + +class Window (BaseModel, frozen = True): + WIDTH: int = 1024 + HEIGHT: int = 768 + diff --git a/main.py b/main.py index 389489f..1a4b54e 100644 --- a/main.py +++ b/main.py @@ -12,6 +12,7 @@ from playsound import playsound from pygame.locals import * from aques import Aques +from common_const import * from common_module import CommonModule from mode import Mode from talk import Talk @@ -35,9 +36,9 @@ class Main: print (mode) pygame.init () - screen: pygame.Surface = pygame.display.set_mode ((1024, 768)) + screen: pygame.Surface = pygame.display.set_mode ((Window.WIDTH, Window.HEIGHT)) balloon = pygame.transform.scale (pygame.image.load ('talking.png'), - (1024, 384)) + (Window.WIDTH, 384)) if goatoh_mode: balloon = pygame.transform.flip (balloon, False, True) pygame.mixer.init (frequency = 44100)