定数化

This commit is contained in:
2024-04-04 20:56:17 +09:00
parent 5aad85c9f6
commit 4bbc5975a7
2 changed files with 11 additions and 2 deletions
+7
View File
@@ -0,0 +1,7 @@
from pydantic import BaseModel
class CWindow (BaseModel, frozen = True):
WIDTH: int = 1024
HEIGHT: int = 768
+4 -2
View File
@@ -12,6 +12,7 @@ from playsound import playsound
from pygame.locals import * from pygame.locals import *
from aques import Aques from aques import Aques
from common_const import *
from common_module import CommonModule from common_module import CommonModule
from talk import Talk from talk import Talk
from youtube import * from youtube import *
@@ -24,11 +25,12 @@ class Main:
# ウィンドゥの初期化 # ウィンドゥの初期化
pygame.init () pygame.init ()
screen: pygame.Surface = pygame.display.set_mode ((1024, 768)) screen: pygame.Surface = pygame.display.set_mode (
(CWindow.WIDTH, CWindow.HEIGHT))
# 吹き出し # 吹き出し
balloon = pygame.transform.scale (pygame.image.load ('talking.png'), balloon = pygame.transform.scale (pygame.image.load ('talking.png'),
(1024, 384)) (CWindow.WIDTH, 384))
if goatoh_mode: if goatoh_mode:
balloon = pygame.transform.flip (balloon, False, True) balloon = pygame.transform.flip (balloon, False, True)